TelemetryKeyManagementService

Reports key generation and signing to Telemetry, and delegates everything else unchanged.

The SDK's instrumentation used to stop at the HTTP boundary, so a host could see that a request was slow without seeing that the time went to an HSM round trip. Wrapping the configured service closes that gap without every provider plugin having to carry instrumentation of its own.

Kotlin interface delegation supplies every other member, so a method added to KeyManagementService keeps working here rather than silently losing its implementation.

val kms = TelemetryKeyManagementService(AwsKeyManagementService(...))

Nothing is recorded until a host installs a sink. Key material and signed bytes are never attached to an event; the algorithm is, because it is low-cardinality and useful.

Constructors

Link copied to clipboard
constructor(delegate: KeyManagementService)

Functions

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

Deletes a key from the key management service.

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

Generates a new cryptographic key by algorithm name.

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

Generates a new cryptographic key.

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

Retrieves the public key information for a given key ID.

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

Returns the set of algorithms supported by this KMS instance.

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

Signs data using the specified key by algorithm name.

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

Signs data using the specified key.

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

Checks if an algorithm by name is supported.

open suspend override 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.