From 5509558eedbcd90f130b32d4e6c41632da291b15 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Tue, 18 Jan 2022 17:40:16 +0530 Subject: Parameterize key and key identifier types for KeyManager (#1669) --- .../src/main/kotlin/dev/msfjarvis/aps/crypto/KeyManager.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crypto-common/src/main/kotlin/dev/msfjarvis/aps/crypto/KeyManager.kt') diff --git a/crypto-common/src/main/kotlin/dev/msfjarvis/aps/crypto/KeyManager.kt b/crypto-common/src/main/kotlin/dev/msfjarvis/aps/crypto/KeyManager.kt index dacdfc6a..aa71abf6 100644 --- a/crypto-common/src/main/kotlin/dev/msfjarvis/aps/crypto/KeyManager.kt +++ b/crypto-common/src/main/kotlin/dev/msfjarvis/aps/crypto/KeyManager.kt @@ -12,7 +12,7 @@ import com.github.michaelbull.result.Result * used by an implementation of [CryptoHandler] to obtain eligible public or private keys as * required. */ -public interface KeyManager { +public interface KeyManager { /** * Inserts a [key] into the store. If the key already exists, this method will return @@ -28,7 +28,7 @@ public interface KeyManager { * implementations to figure out for themselves. For example, in GPG this can be a full * hexadecimal key ID, an email, a short hex key ID, and probably a few more things. */ - public suspend fun getKeyById(id: String): Result + public suspend fun getKeyById(id: KeyIdentifier): Result /** Returns all keys currently in the store as a [List]. */ public suspend fun getAllKeys(): Result, Throwable> @@ -37,7 +37,7 @@ public interface KeyManager { * Get a stable identifier for the given [key]. The returned key ID should be suitable to be used * as an identifier for the cryptographic identity tied to this key. */ - public suspend fun getKeyId(key: Key): String? + public suspend fun getKeyId(key: Key): KeyIdentifier? /** Given a [fileName], return whether this instance can handle it. */ public fun canHandle(fileName: String): Boolean -- cgit v1.2.3