Options
All
  • Public
  • Public/Protected
  • All
Menu

Class KeyPair

Hierarchy

  • KeyPair

Index

Constructors

constructor

Methods

Static createKeyPairFromPrivateKeyString

  • createKeyPairFromPrivateKeyString(privateKeyString: string): { privateKey: Uint8Array; publicKey: Uint8Array }
  • Creates a key pair from a private key string.

    Parameters

    • privateKeyString: string

      A hex encoded private key string.

    Returns { privateKey: Uint8Array; publicKey: Uint8Array }

    The key pair.

    • privateKey: Uint8Array
    • publicKey: Uint8Array

Static sign

  • sign(keyPair: any, data: Uint8Array): Uint8Array
  • Signs a data buffer with a key pair.

    Parameters

    • keyPair: any

      The key pair to use for signing.

    • data: Uint8Array

      The data to sign.

    Returns Uint8Array

    The signature.

Static verify

  • verify(publicKey: Uint8Array, data: Uint8Array, signature: Uint8Array): boolean
  • Verifies a signature.

    Parameters

    • publicKey: Uint8Array

      The public key to use for verification.

    • data: Uint8Array

      The data to verify.

    • signature: Uint8Array

      The signature to verify.

    Returns boolean

    true if the signature is verifiable, false otherwise.

Generated using TypeDoc