Kill the Clipboard - SMART Health Cards Library - v1.0.2
    Preparing search index...

    Class Directory

    Directory is a lightweight representation of issuer metadata used by SMART Health Cards code paths. It contains a collection of issuer info objects including the issuer identifier, known JWK keys and optionally Certificate Revocation Lists (CRLs).

    Index

    Constructors

    Methods

    • Build a Directory from a parsed JSON object matching the published directory schema.

      This method is defensive: if issuer.iss is missing or not a string it will be coerced to an empty string; if keys or crls are not arrays they will be treated as empty arrays.

      Parameters

      • directoryJson: DirectoryJSON

        The JSON object to convert into a Directory

      Returns Directory

      A new Directory instance

      const directory = Directory.fromJSON(parsedJson)
      
    • Create a Directory by fetching issuer metadata (JWKS) and CRLs from the provided issuer base URLs.

      For each issuer URL the method attempts to fetch /.well-known/jwks.json and will then attempt to fetch CRLs for each key at /.well-known/crl/{kid}.json. Failures to fetch a JWKS will skip that issuer; failures to fetch a CRL for an individual key will skip that key's CRL but keep the key. Errors are logged via console.debug and unexpected exceptions are caught and logged with console.error.

      Parameters

      • issUrls: string[]

        Array of issuer base URLs to fetch (e.g. https://example.com/issuer)

      Returns Promise<Directory>

      A Directory containing any successfully fetched issuer info

      const directory = await Directory.fromURLs(['https://example.com/issuer'])