Secp256k1PrivateKey

The Secp256k1PrivateKey class represents a private key that uses the secp256k1 elliptic curve. It extends the PrivateKey class and implements the SignableKey, StorableKey, ExportableKey, and DerivableKey interfaces.

Parameters

nativeValue

The raw byte array value of the private key.

See also

Constructors

Link copied to clipboard
constructor(nativeValue: ByteArray)

Creates a Secp256k1PrivateKey object with the specified nativeValue.

Properties

Link copied to clipboard

A mutable map that contains additional key specifications.

Link copied to clipboard
open override val raw: ByteArray

The raw byte array value of the private key.

Link copied to clipboard
open override val restorationIdentifier: String

This variable represents the restoration identifier for a key. It is a unique identifier used for restoring the key from storage.

Link copied to clipboard
open override val size: Int

The size of the private key in bytes.

Link copied to clipboard
open override val storableData: ByteArray

Represents the storable data of a key.

Link copied to clipboard
open override val type: KeyTypes

The type of the key, which is set to KeyTypes.EC.

Functions

Link copied to clipboard

Evaluates if this key implements VerifiableKey

Link copied to clipboard
open override fun derive(derivationPath: DerivationPath): PrivateKey

Derives a private key using the given derivation path.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Checks if the current Key object is equal to the provided object. Two Key objects are considered equal if the following conditions are met:

Link copied to clipboard

Returns the value of the key curve for this private key

Link copied to clipboard

Returns an instance of the key curve for this private key

Link copied to clipboard

Returns the encoded raw value into base 64 url

Link copied to clipboard

Returns the index for this private key

Link copied to clipboard
open override fun getJwk(): JWK

Retrieves the JWK (JSON Web Key) representation of the private key.

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

Returns the PEM (Privacy-Enhanced Mail) representation of the private key. The key is encoded in base64 and wrapped with "BEGIN" and "END" markers.

Link copied to clipboard

Searches the value based on the input key, if it exists

Link copied to clipboard

Returns the value of this private key

Link copied to clipboard
open override fun hashCode(): Int

Computes the hash code of the Key object. The hash code is calculated based on the properties of the keySpecification map and the raw byte array. Two Key objects with the same keySpecification map and the raw byte array are guaranteed to have the same hash code.

Link copied to clipboard
fun isCurve(curve: String): Boolean

Evaluates if the input curve matches the actual curve this key has

Link copied to clipboard

Evaluates if this key implements DerivableKey

Link copied to clipboard

Evaluates if this key implements ExportableKey

Link copied to clipboard

Evaluates if this key implements ImportableKey

Link copied to clipboard

Evaluates if this key implements SignableKey

Link copied to clipboard
open override fun jca(): <Error class: unknown class>
Link copied to clipboard
open override fun jwkWithKid(kid: String): JWK

Retrieves the JWK (JSON Web Key) representation of the private key with the specified key identifier (kid).

Link copied to clipboard
open override fun publicKey(): PublicKey

Returns the public key corresponding to this private key.

Link copied to clipboard
open override fun sign(message: ByteArray): ByteArray

Signs a byte array message using the private key.