EcPrivateKeyOkp

class EcPrivateKeyOkp(val curve: EcCurve, d: ByteArray, val x: ByteArray) : EcPrivateKey

EC Private Key with Octet Key Pairs.

Parameters

x

the X coordinate of the public key.

Constructors

Link copied to clipboard
constructor(curve: EcCurve, d: ByteArray, x: ByteArray)

Properties

Link copied to clipboard
open override 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
open override val publicKey: EcPublicKey

The public part of the key.

Link copied to clipboard

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
open override fun duplicate(): EcPrivateKeyOkp

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
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open 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
open 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

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