Kill the Clipboard - SMART Health Cards Library - v1.1.0
    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

    • 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'])
      
    • Fetch a snapshot of the VCI Directory published by The Commons Project and build a Directory from it.

      This helper fetches a well-known VCI snapshot JSON file and delegates to Directory.fromJSON to produce a Directory instance. If the snapshot cannot be retrieved (non-2xx response) the function throws an Error.

      Returns Promise<Directory>

      A Directory populated from the VCI snapshot

      Error when the VCI snapshot HTTP fetch returns a non-OK status

      const directory = await Directory.fromVCI()