KmsErrorHandler
object KmsErrorHandler
Shared logging and failure conversion for KMS implementations.
Functions
Link copied to clipboard
fun createErrorContext(keyId: KeyId? = null, algorithm: Algorithm? = null, operation: String? = null, additional: Map<String, Any?> = emptyMap()): Map<String, Any?>
Creates logging context; additional fields override standard fields with the same name.
Link copied to clipboard
Link copied to clipboard
fun handleGenericException(logger: Logger, keyId: KeyId? = null, algorithm: Algorithm? = null, operation: String, e: Exception): GenerateKeyResult.Failure?
Logs an ordinary exception and converts it to a key-generation failure when algorithm is supplied, otherwise returns null. Cancellation and interruption propagate unchanged.