interface KeyPair {
    clear(): void;
    getPrivateKey(): Uint8Array;
    getPublicKey(): string;
    getSeed(): Uint8Array;
    open(message: Uint8Array, sender: string): Uint8Array;
    seal(input: Uint8Array, recipient: string, nonce?: Uint8Array): Uint8Array;
    sign(input: Uint8Array): Uint8Array;
    verify(input: Uint8Array, sig: Uint8Array): boolean;
}

Methods

  • Clears the secret stored in the keypair. After clearing a keypair cannot be used or recovered.

    Returns void

  • Returns the private key associated with the KeyPair

    Returns Uint8Array

    Uint8Array

    NKeysError

  • Returns the public key associated with the KeyPair

    Returns string

    NKeysError

  • Returns the PrivateKey's seed.

    Returns Uint8Array

    Uint8Array

    NKeysError

  • Parameters

    • message: Uint8Array
    • sender: string

    Returns Uint8Array

  • Parameters

    • input: Uint8Array
    • recipient: string
    • Optionalnonce: Uint8Array

    Returns Uint8Array

  • Returns the digital signature of signing the input with the the KeyPair's private key.

    Parameters

    • input: Uint8Array

    Returns Uint8Array

    Uint8Array

    NKeysError

  • Returns true if the signature can be verified with the KeyPair

    Parameters

    • input: Uint8Array
    • sig: Uint8Array

    Returns boolean

    NKeysError