Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val isDestroyed: Boolean

true if this key has been closed/destroyed, false otherwise.

Link copied to clipboard
abstract val publicKey: PublicKey

The public part of the key.

Functions

Link copied to clipboard
abstract override fun close()

Securely zeroes out the private key material in memory and marks this key as destroyed. Subsequent cryptographic operations or property accesses on this instance will throw IllegalStateException.

Link copied to clipboard
fun destroy()

Cryptographic alias for close.

Link copied to clipboard
abstract fun duplicate(): PrivateKey

Creates an independent duplicate of this private key with its own lifecycle and memory buffer. The returned key must be closed independently.

Link copied to clipboard
abstract fun toCoseKey(additionalLabels: Map<CoseLabel, DataItem> = emptyMap()): CoseKey

Creates a CoseKey object for the key.

Link copied to clipboard

Serializes this private key as a CBOR DataItem encoding a COSE_Key.

Link copied to clipboard
Link copied to clipboard
abstract fun toJwk(additionalClaims: JsonObject? = null): JsonObject

Encodes the private key as a JSON Web Key according to RFC 7517.

Link copied to clipboard
abstract fun toPem(): String

Encode this key in PEM format.