Options
All
  • Public
  • Public/Protected
  • All
Menu

Module ucan-storage

Index

Functions

  • Construct and sign a new UCAN token with the given UcanStorageOptions. The UCAN is specific to the Storage services and semantics.

    Parameters

    Returns Promise<string>

    a Promise that resolves to the encoded JWT representation of the signed UCAN token.

  • isUcan(encodedUcan: string): boolean
  • Check if input is a encoded UCAN

    Parameters

    • encodedUcan: string

    Returns boolean

  • Validate the given encoded UCAN token and return the parsed instance.

    Note This doesn't validate it's a valid UCAN chain but rather a single ucan is, disregarding the proof chain.

    You may optionally skip parts of the validation process by passing in ValidateOptions. By default, all validation checks are performed.

    If the token is valid, returns a ValidateResult containing the parsed UcanHeader and UcanPayload, as well as the signature Uint8Array.

    Parameters

    • jwt: string

      a UCAN token, encoded as a JWT string

    • options: undefined | ValidateOptions

    Returns Promise<ValidateResult>

    a Promise that resolves to a ValidateResult if the token is valid, or rejects with an Error if validation fails.

Generated using TypeDoc