Skip to content

KeyPair⚓︎

KeyPair
Represents an ED25519 private and public key.

Constructors⚓︎

Constructor⚓︎

new KeyPair(privateKey): KeyPair;

Creates a key pair from a private key.

Parameters⚓︎

Parameter Type Description
privateKey PrivateKey Private key.

Returns⚓︎

KeyPair

Accessors⚓︎

privateKey⚓︎

Get Signature⚓︎

get privateKey(): PrivateKey;
KeyPair.privateKey
Gets the private key.
Returns⚓︎

PrivateKey

Private key.


publicKey⚓︎

Get Signature⚓︎

get publicKey(): PublicKey;
KeyPair.publicKey
Gets the public key.
Returns⚓︎

PublicKey

Public key.

Methods⚓︎

sign()⚓︎

sign(message): Signature;
KeyPair.sign
Signs a message with the private key.

Parameters⚓︎

Parameter Type Description
message Uint8Array Message to sign.

Returns⚓︎

Signature

Message signature.