EcPrivateKey

sealed class EcPrivateKey : PrivateKey

An EC private key.

Parameters

curve

the curve of the key.

d

the private value of the key.

Inheritors

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open val curve: EcCurve
Link copied to clipboard
open val d: ByteArray

The private scalar (d) of the key.

Link copied to clipboard
override val isDestroyed: Boolean

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

Link copied to clipboard
Link copied to clipboard
abstract override val publicKey: EcPublicKey

The public part of the key.

Functions

Link copied to clipboard
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 override fun duplicate(): EcPrivateKey

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 override fun toCoseKey(additionalLabels: Map<CoseLabel, DataItem>): 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 override fun toJwk(additionalClaims: JsonObject?): JsonObject

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

Link copied to clipboard
open override fun toPem(): String

Encode this key in PEM format