KeyManagementService

Abstract interface for key management operations. This interface is chain-agnostic and DID-method-agnostic.

All implementations MUST advertise their supported algorithms.

Inheritors

Functions

Link copied to clipboard
abstract suspend fun deleteKey(keyId: KeyId): DeleteKeyResult

Deletes a key from the key management service.

Link copied to clipboard
open suspend fun generateKey(algorithmName: String, options: Map<String, Any?> = emptyMap()): GenerateKeyResult

Generates a new cryptographic key by algorithm name.

abstract suspend fun generateKey(algorithm: Algorithm, options: Map<String, Any?> = emptyMap()): GenerateKeyResult

Generates a new cryptographic key.

Link copied to clipboard
abstract suspend fun getPublicKey(keyId: KeyId): GetPublicKeyResult

Retrieves the public key information for a given key ID.

Link copied to clipboard
abstract suspend fun getSupportedAlgorithms(): Set<Algorithm>

Returns the set of algorithms supported by this KMS instance.

Link copied to clipboard
open suspend fun sign(keyId: KeyId, data: ByteArray, algorithmName: String?): SignResult

Signs data using the specified key by algorithm name.

abstract suspend fun sign(keyId: KeyId, data: ByteArray, algorithm: Algorithm? = null): SignResult

Signs data using the specified key.

Link copied to clipboard
open suspend fun supportsAlgorithm(algorithmName: String): Boolean

Checks if an algorithm by name is supported.

open suspend fun supportsAlgorithm(algorithm: Algorithm): Boolean

Checks if a specific algorithm is supported.

Link copied to clipboard

Wraps this service so its key generation and signing are reported to Telemetry.