Skip to main content

Class: Secp256k1PrivateKey

Extends​

  • UniffiAbstractObject

Implements​

Constructors​

Constructor​

new Secp256k1PrivateKey(bytes): Secp256k1PrivateKey;

Parameters​

bytes​

ArrayBuffer

Returns​

Secp256k1PrivateKey

Overrides​

UniffiAbstractObject.constructor

Properties​

[destructorGuardSymbol]​

readonly [destructorGuardSymbol]: UniffiGcObject;

[pointerLiteralSymbol]​

readonly [pointerLiteralSymbol]: bigint;

[uniffiTypeNameSymbol]​

readonly [uniffiTypeNameSymbol]: "Secp256k1PrivateKey" = "Secp256k1PrivateKey";

Methods​

equals()​

equals(other): boolean;

Parameters​

other​

Secp256k1PrivateKey

Returns​

boolean


publicKey()​

publicKey(): Secp256k1PublicKeyLike;

Returns​

Secp256k1PublicKeyLike

Implementation of​

Secp256k1PrivateKeyLike.publicKey


scheme()​

scheme(): SignatureScheme;

Returns​

SignatureScheme

Implementation of​

Secp256k1PrivateKeyLike.scheme


signPersonalMessage()​

signPersonalMessage(message): UserSignatureLike;

Sign a personal message and return a UserSignature.

Parameters​

message​

PersonalMessageLike

Returns​

UserSignatureLike

Implementation of​

Secp256k1PrivateKeyLike.signPersonalMessage


signTransaction()​

signTransaction(transaction): UserSignatureLike;

Sign a transaction and return a UserSignature.

Parameters​

transaction​

TransactionLike

Returns​

UserSignatureLike

Implementation of​

Secp256k1PrivateKeyLike.signTransaction


toBech32()​

toBech32(): string;

Encode this private key as flag || privkey in Bech32 starting with "iotaprivkey" to a string.

Returns​

string

Implementation of​

Secp256k1PrivateKeyLike.toBech32


toBytes()​

toBytes(): ArrayBuffer;

Serialize this private key to bytes.

Returns​

ArrayBuffer

Implementation of​

Secp256k1PrivateKeyLike.toBytes


toDebugString()​

toDebugString(): string;

Returns​

string


toDer()​

toDer(): ArrayBuffer;

Serialize this private key as DER-encoded PKCS#8

Returns​

ArrayBuffer

Implementation of​

Secp256k1PrivateKeyLike.toDer


toPem()​

toPem(): string;

Serialize this private key as PEM-encoded PKCS#8

Returns​

string

Implementation of​

Secp256k1PrivateKeyLike.toPem


toString()​

toString(): string;

Returns a string representation of an object.

Returns​

string


trySign()​

trySign(message): Secp256k1SignatureLike;

Parameters​

message​

ArrayBuffer

Returns​

Secp256k1SignatureLike

Implementation of​

Secp256k1PrivateKeyLike.trySign


trySignSimple()​

trySignSimple(message): SimpleSignatureLike;

Parameters​

message​

ArrayBuffer

Returns​

SimpleSignatureLike

Implementation of​

Secp256k1PrivateKeyLike.trySignSimple


trySignUser()​

trySignUser(message): UserSignatureLike;

Parameters​

message​

ArrayBuffer

Returns​

UserSignatureLike

Implementation of​

Secp256k1PrivateKeyLike.trySignUser


uniffiDestroy()​

uniffiDestroy(): void;

Explicitly tell Rust to destroy the native peer that backs this object.

Once this method has been called, any following method calls will throw an error.

Can be called more than once.

Returns​

void

Overrides​

UniffiAbstractObject.uniffiDestroy

uniffiUse()​

uniffiUse<T>(block): T;

A convenience method to use this object, then destroy it after its use.

Type Parameters​

T​

T

Parameters​

block​

(obj) => T

Returns​

T

Inherited from​

UniffiAbstractObject.uniffiUse

verifyingKey()​

verifyingKey(): Secp256k1VerifyingKeyLike;

Returns​

Secp256k1VerifyingKeyLike

Implementation of​

Secp256k1PrivateKeyLike.verifyingKey


fromBech32()​

static fromBech32(value): Secp256k1PrivateKeyLike;

Decode a private key from flag || privkey in Bech32 starting with "iotaprivkey".

Parameters​

value​

string

Returns​

Secp256k1PrivateKeyLike


fromDer()​

static fromDer(bytes): Secp256k1PrivateKeyLike;

Deserialize PKCS#8 private key from ASN.1 DER-encoded data (binary format).

Parameters​

bytes​

ArrayBuffer

Returns​

Secp256k1PrivateKeyLike


fromMnemonic()​

static fromMnemonic(
phrase,
accountIndex?,
password?
): Secp256k1PrivateKeyLike;

Construct the private key from a mnemonic phrase

Parameters​

phrase​

string

accountIndex?​

bigint = ...

password?​

string = ""

Returns​

Secp256k1PrivateKeyLike


fromMnemonicWithPath()​

static fromMnemonicWithPath(
phrase,
path,
password?
): Secp256k1PrivateKeyLike;

Create an instance from a mnemonic phrase and a derivation path like "m/54'/4218'/0'/0/0"

Parameters​

phrase​

string

path​

string

password?​

string = ""

Returns​

Secp256k1PrivateKeyLike


fromPem()​

static fromPem(s): Secp256k1PrivateKeyLike;

Deserialize PKCS#8-encoded private key from PEM.

Parameters​

s​

string

Returns​

Secp256k1PrivateKeyLike


instanceOf()​

static instanceOf(obj_): obj_ is Secp256k1PrivateKey;

Parameters​

obj_​

any

Returns​

obj_ is Secp256k1PrivateKey


random()​

static random(): Secp256k1PrivateKeyLike;

Returns​

Secp256k1PrivateKeyLike