Namespace
Get the public key associated with this private key.
The public key can be freely given and used by other parties to verify the signatures generated by this private key.
Derive a new private key at the given wallet index.
Only currently supported for keys created with fromMnemonic()
; other keys will throw
an error.
You can check if a key supports derivation with .supportsDerivation()
If this key does not support derivation.
If this key does not support derivation.
Create a keystore with a given passphrase.
The key can be recovered later with fromKeystore()
.
Note that this will not retain the ancillary data used for
deriving child keys, thus .derive()
on the restored key will
throw even if this instance supports derivation.
Optional
passphrase: string = ""Static
fromConstruct a private key from bytes. Requires DER header.
Static
fromConstruct a ECDSA private key from bytes.
Static
fromConstruct a ED25519 private key from bytes.
Static
fromRecover a private key from a keystore, previously created by .toKeystore()
.
This key will not support child key derivation.
Optional
passphrase: string = ""If the passphrase is incorrect or the hash fails to validate.
Static
fromOptional
passphrase: string = ""Mnemonic.from[Words|String]().to[Ed25519|Ecdsa]PrivateKey()
insteadRecover a private key from a mnemonic phrase (and optionally a password).
Static
fromRecover a private key from a pem string; the private key may be encrypted.
This method assumes the .pem file has been converted to a string already.
If passphrase
is not null or empty, this looks for the first ENCRYPTED PRIVATE KEY
section and uses passphrase
to decrypt it; otherwise, it looks for the first PRIVATE KEY
section and decodes that as a DER-encoded private key.
Optional
passphrase: string = ""Static
fromConstruct a Ed25519 private key from a Uint8Array seed.
Static
fromConstruct a Ed25519 private key from a Uint8Array seed.
Static
fromConstruct a private key from a hex-encoded string. Requires DER header.
Static
fromConstruct a ECDSA private key from a hex-encoded string.
Static
fromConstruct a Ed25519 private key from a hex-encoded string.
Static
generateDepredated - Use generateED25519()
instead
Generate a random Ed25519 private key.
Static
generateDepredated - Use generateED25519Async()
instead
Generate a random Ed25519 private key.
Static
generateECDSAGenerate a random EDSA private key.
Static
generateECDSAAsyncGenerate a random ECDSA private key.
Static
generateED25519Generate a random Ed25519 private key.
Static
generateED25519Generate a random Ed25519 private key.
Generated using TypeDoc
proto