The JwkSet class which handles construction, validation, and loading of Jwk Sets.

Constructors

Properties

Accessors

Methods

Constructors

  • Parameters

    • jwkSet: {
          keys: {
              alg?: string;
              e?: string;
              key_ops?: string[];
              kid?: string;
              kty: string;
              n?: string;
              use?: string;
              x5c?: string[];
              x5t?: string;
              x5t#S256?: string;
              x5u?: string;
          }[];
      }
      • keys: {
            alg?: string;
            e?: string;
            key_ops?: string[];
            kid?: string;
            kty: string;
            n?: string;
            use?: string;
            x5c?: string[];
            x5t?: string;
            x5t#S256?: string;
            x5u?: string;
        }[]
    • Optional options: JwkSetOptions

    Returns JwkSet

Properties

expiresAt: undefined | number
keys: Jwk[]

Accessors

  • get isExpired(): boolean
  • A function for checking if a JWK set is expired.

    Returns boolean

    • a boolean based on if the JWK set is expired.

Methods

  • Validates the input and converts it to a JwkSet.

    Parameters

    • value: unknown

      Any unknown value that is needing validation to use as a Jwk Set.

    • Optional options: JwkSetOptions

      JwkSet options used to refresh the data.

    Returns JwkSet

    • A new JWK set which has been validated against the JWK set type.
  • A wrapper function for loading the jwk from the specified endpoint url. This function will pass in an expiration value to the from function.

    Parameters

    • jwkEndpoint: string | URL

      The endpoint from which the jwk is being fetched.

    Returns Promise<JwkSet>

    • output of the from function. A new JWK set which has been validated and with an expiration.