aboutsummaryrefslogtreecommitdiffstats
path: root/crypto-common/src/main/kotlin/dev/msfjarvis/aps/crypto/Key.kt
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2022-01-09 15:37:45 +0530
committerGitHub <noreply@github.com>2022-01-09 10:07:45 +0000
commitccb33af854132f1b35b71393ff68d24850de6960 (patch)
tree52e71e7ca560194d863b7c823385271e42eea7d0 /crypto-common/src/main/kotlin/dev/msfjarvis/aps/crypto/Key.kt
parent6c6ade85a8696142b5fc13df9034f73b4089c912 (diff)
downloadHardenedPass-ccb33af854132f1b35b71393ff68d24850de6960.tar.gz
HardenedPass-ccb33af854132f1b35b71393ff68d24850de6960.zip
Refactor and simplify KeyManager API (#1650)
Diffstat (limited to 'crypto-common/src/main/kotlin/dev/msfjarvis/aps/crypto/Key.kt')
-rw-r--r--crypto-common/src/main/kotlin/dev/msfjarvis/aps/crypto/Key.kt14
1 files changed, 14 insertions, 0 deletions
diff --git a/crypto-common/src/main/kotlin/dev/msfjarvis/aps/crypto/Key.kt b/crypto-common/src/main/kotlin/dev/msfjarvis/aps/crypto/Key.kt
new file mode 100644
index 00000000..73dee199
--- /dev/null
+++ b/crypto-common/src/main/kotlin/dev/msfjarvis/aps/crypto/Key.kt
@@ -0,0 +1,14 @@
+/*
+ * Copyright © 2014-2021 The Android Password Store Authors. All Rights Reserved.
+ * SPDX-License-Identifier: GPL-3.0-only
+ */
+
+package dev.msfjarvis.aps.crypto
+
+/**
+ * A simple value class wrapping over a [ByteArray] that can be used as a key type for cryptographic
+ * purposes. The public/private distinction is elided specifically to defer that decision to
+ * implementations of [KeyManager]. Similarly, identification of the key's identities is also
+ * deferred to [KeyManager] to ensure maximum flexibility.
+ */
+@JvmInline public value class Key(public val contents: ByteArray)