Class containing SECP256K1 related utility methods.

Constructors

Methods

  • Generates key pair in raw bytes, where the publicKey is compressed.

    Returns Promise<{
        privateKey: Uint8Array;
        publicKey: Uint8Array;
    }>

  • Gets the compressed public key of the given private key.

    Parameters

    • privateKey: Uint8Array

    Returns Promise<Uint8Array>

  • Creates a private key in raw bytes from the given SECP256K1 JWK.

    Parameters

    Returns Uint8Array

  • Creates a compressed key in raw bytes from the given SECP256K1 JWK.

    Parameters

    Returns Uint8Array

  • Signs the provided content using the provided JWK.

    Parameters

    Returns Promise<Uint8Array>

  • Verifies a signature against the provided payload hash and public key.

    Parameters

    • content: Uint8Array
    • signature: Uint8Array
    • publicJwk: PublicJwk

    Returns Promise<boolean>

    a boolean indicating whether the signature is valid.