Hierarchy

  • SignJWT
    • SignICT

Constructors

Properties

_payload: Partial<ICTPayload> = {}

Payload of the ICT.

Methods

  • Set "aud" (Audience) Claim.

    Parameters

    • audience: string | string[]

      "aud" (Audience) Claim value to set on the JWT Claims Set.

    Returns SignICT

  • Set "exp" (Expiration Time) Claim.

    Parameters

    • input: string | number

      "exp" (Expiration Time) Claim value to set on the JWT Claims Set. When number is passed that is used as a value, when string is passed it is resolved to a time span and added to the current timestamp.

    Returns SignICT

  • Set "iat" (Issued At) Claim and sets the "exp" (Expiration) Claim to the recommended 60 seconds later, if not yet set.

    Parameters

    • Optional input: number

      "iat" (Issued At) Claim value to set on the JWT Claim Set or undefined to use now.

      Optional

    Returns SignICT

  • Set "iss" (Issuer) Claim.

    Parameters

    • issuer: string

      "Issuer" Claim value to set on the JWT Claims Set.

    Returns SignICT

  • Set "nbf" (Not Before) Claim.

    Parameters

    • input: string | number

      "nbf" (Not Before) Claim value to set on the JWT Claims Set. When number is passed that is used as a value, when string is passed it is resolved to a time span and added to the current timestamp.

    Returns SignICT

  • Set "sub" (Subject) Claim.

    Parameters

    • subject: string

      "sub" (Subject) Claim value to set on the JWT Claims Set.

    Returns SignICT

  • Signs and returns the JWT.

    Parameters

    • key: Uint8Array | KeyLike

      Private Key or Secret to sign the JWT with. See Algorithm Key Requirements.

    • Optional options: SignOptions

      JWT Sign options.

      Optional

    Returns Promise<string>

Generated using TypeDoc