Skip to main content

Secp256r1PrivateKey

open class Secp256r1PrivateKey : Disposable, AutoCloseable, Secp256r1PrivateKeyInterface

Constructors

Secp256r1PrivateKeyconstructor(bytes: ByteArray)

Functions

NameSummary
close@Synchronized
open override fun close()
destroyopen override fun destroy()
equalsopen operator override fun equals(other: Any?): Boolean
publicKeyopen override fun publicKey(): Secp256r1PublicKey
Get the public key corresponding to this private key.
schemeopen override fun scheme(): SignatureScheme
signPersonalMessageopen override fun signPersonalMessage(message: PersonalMessage): UserSignature
Sign a personal message and return a UserSignature.
signTransactionopen override fun signTransaction(transaction: Transaction): UserSignature
Sign a transaction and return a UserSignature.
toBech32open override fun toBech32(): String
Encode this private key as `flag
toBytesopen override fun toBytes(): ByteArray
Serialize this private key to bytes.
toDeropen override fun toDer(): ByteArray
Serialize this private key as DER-encoded PKCS#8
toPemopen override fun toPem(): String
Serialize this private key as PEM-encoded PKCS#8
toStringopen override fun toString(): String
trySignopen override fun trySign(message: ByteArray): Secp256r1Signature
Sign a message and return a Secp256r1Signature.
trySignSimpleopen override fun trySignSimple(message: ByteArray): SimpleSignature
Sign a message and return a SimpleSignature.
trySignUseropen override fun trySignUser(message: ByteArray): UserSignature
Sign a message and return a UserSignature.
verifyingKeyopen override fun verifyingKey(): Secp256r1VerifyingKey

Companion object functions

NameSummary
fromBech32fun fromBech32(value: String): Secp256r1PrivateKey
Decode a private key from `flag
fromDerfun fromDer(bytes: ByteArray): Secp256r1PrivateKey
Deserialize PKCS#8 private key from ASN.1 DER-encoded data (binary format).
fromMnemonicfun fromMnemonic(phrase: String, accountIndex: ULong, password: String = ""): Secp256r1PrivateKey
Construct the private key from a mnemonic phrase
fromMnemonicWithPathfun fromMnemonicWithPath(phrase: String, path: String, password: String = ""): Secp256r1PrivateKey
Create an instance from a mnemonic phrase and a derivation path like "m/74'/4218'/0'/0/0"
fromPemfun fromPem(s: String): Secp256r1PrivateKey
Deserialize PKCS#8-encoded private key from PEM.
randomfun random(): Secp256r1PrivateKey
Generate a new random Secp256r1PrivateKey