Cryptographic utility functions, such as hashing, signing, and verifying

Constructors

Methods

Constructors

Methods

  • Computes a digest of the payload by:

    Parameters

    • payload: any

    Returns Uint8Array

    The SHA-256 hash of the canonicalized payload, represented as a byte array.

  • Signs the provided payload and produces a compact JSON Web Signature (JWS).

    Parameters

    Returns Promise<string>

    A promise that resolves to the generated compact JWS.

    Throws

    Will throw an error if the specified algorithm is not supported.

  • Verifies the integrity of a message or resource's signature.

    Parameters

    Returns Promise<string>

    A promise that resolves to the DID of the signer if verification is successful.

    Throws

    Various errors related to invalid input or failed verification.