Class: Secp256r1PrivateKey
Extends
UniffiAbstractObject
Implements
Constructors
Constructor
new Secp256r1PrivateKey(bytes): Secp256r1PrivateKey;
Parameters
bytes
ArrayBuffer
Returns
Secp256r1PrivateKey
Overrides
UniffiAbstractObject.constructor
Properties
[destructorGuardSymbol]
readonly [destructorGuardSymbol]: UniffiGcObject;
[pointerLiteralSymbol]
readonly [pointerLiteralSymbol]: bigint;
[uniffiTypeNameSymbol]
readonly [uniffiTypeNameSymbol]: "Secp256r1PrivateKey" = "Secp256r1PrivateKey";
Methods
equals()
equals(other): boolean;
Parameters
other
Secp256r1PrivateKey
Returns
boolean
publicKey()
publicKey(): Secp256r1PublicKeyLike;
Get the public key corresponding to this private key.
Returns
Implementation of
Secp256r1PrivateKeyLike.publicKey
scheme()
scheme(): SignatureScheme;
Returns
Implementation of
Secp256r1PrivateKeyLike.scheme
signPersonalMessage()
signPersonalMessage(message): UserSignatureLike;
Sign a personal message and return a UserSignature.
Parameters
message
Returns
Implementation of
Secp256r1PrivateKeyLike.signPersonalMessage
signTransaction()
signTransaction(transaction): UserSignatureLike;
Sign a transaction and return a UserSignature.
Parameters
transaction
Returns
Implementation of
Secp256r1PrivateKeyLike.signTransaction
toBech32()
toBech32(): string;
Encode this private key as flag || privkey in Bech32 starting with
"iotaprivkey" to a string.
Returns
string
Implementation of
Secp256r1PrivateKeyLike.toBech32
toBytes()
toBytes(): ArrayBuffer;
Serialize this private key to bytes.
Returns
ArrayBuffer
Implementation of
Secp256r1PrivateKeyLike.toBytes
toDebugString()
toDebugString(): string;
Returns
string
toDer()
toDer(): ArrayBuffer;
Serialize this private key as DER-encoded PKCS#8
Returns
ArrayBuffer
Implementation of
toPem()
toPem(): string;
Serialize this private key as PEM-encoded PKCS#8
Returns
string
Implementation of
toString()
toString(): string;
Returns a string representation of an object.
Returns
string
trySign()
trySign(message): Secp256r1SignatureLike;
Sign a message and return a Secp256r1Signature.
Parameters
message
ArrayBuffer
Returns
Implementation of
Secp256r1PrivateKeyLike.trySign
trySignSimple()
trySignSimple(message): SimpleSignatureLike;
Sign a message and return a SimpleSignature.
Parameters
message
ArrayBuffer
Returns
Implementation of
Secp256r1PrivateKeyLike.trySignSimple
trySignUser()
trySignUser(message): UserSignatureLike;
Sign a message and return a UserSignature.
Parameters
message
ArrayBuffer
Returns
Implementation of
Secp256r1PrivateKeyLike.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(): Secp256r1VerifyingKeyLike;
Returns
Implementation of
Secp256r1PrivateKeyLike.verifyingKey
fromBech32()
static fromBech32(value): Secp256r1PrivateKeyLike;
Decode a private key from flag || privkey in Bech32 starting with
"iotaprivkey".
Parameters
value
string
Returns
fromDer()
static fromDer(bytes): Secp256r1PrivateKeyLike;
Deserialize PKCS#8 private key from ASN.1 DER-encoded data (binary format).
Parameters
bytes
ArrayBuffer
Returns
fromMnemonic()
static fromMnemonic(
phrase,
accountIndex?,
password?
): Secp256r1PrivateKeyLike;
Construct the private key from a mnemonic phrase
Parameters
phrase
string
accountIndex?
bigint = ...
password?
string = ""
Returns
fromMnemonicWithPath()
static fromMnemonicWithPath(
phrase,
path,
password?
): Secp256r1PrivateKeyLike;
Create an instance from a mnemonic phrase and a derivation path like
"m/74'/4218'/0'/0/0"
Parameters
phrase
string
path
string
password?
string = ""
Returns
fromPem()
static fromPem(s): Secp256r1PrivateKeyLike;
Deserialize PKCS#8-encoded private key from PEM.
Parameters
s
string
Returns
instanceOf()
static instanceOf(obj_): obj_ is Secp256r1PrivateKey;
Parameters
obj_
any
Returns
obj_ is Secp256r1PrivateKey
random()
static random(): Secp256r1PrivateKeyLike;
Generate a new random Secp256r1PrivateKey