This class provides key pair functionality for Ed25519 curve: generating key pairs, encoding key pairs, signing and verifying.

Hierarchy

Constructors

  • Construct an instance of key pair given a secret key. It's generally assumed that these are encoded in base58.

    Parameters

    • secretKey: string

    Returns KeyPairEd25519

Properties

publicKey: PublicKey
secretKey: string

Methods

  • Returns string

  • Parameters

    • message: Uint8Array
    • signature: Uint8Array

    Returns boolean

  • Generate a new random keypair.

    Returns KeyPairEd25519

    Example

    const keyRandom = KeyPair.fromRandom();
    keyRandom.publicKey
    // returns [PUBLIC_KEY]

    keyRandom.secretKey
    // returns [SECRET_KEY]

Generated using TypeDoc