Class containing SECP256K1 related utility methods.

Constructors

Methods

  • Derives a child private key using the given derivation path segment.

    Parameters

    • privateKey: Uint8Array
    • derivationPathSegment: Uint8Array

    Returns Promise<Uint8Array>

  • Derives a hardened hierarchical deterministic private key.

    Parameters

    • privateKey: Uint8Array
    • relativePath: string[]

    Returns Promise<Uint8Array>

  • Derives a hardened hierarchical deterministic public key.

    Parameters

    • privateKey: Uint8Array
    • relativePath: string[]

    Returns Promise<Uint8Array>

    uncompressed public key

  • 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.