UMIS SDK
    Preparing search index...

    Function verifyStatusListToken

    • Verifies a status list token and returns the list. The checks run in this order and the first failure decides: ES256 signature by one of keys with typ statuslist+jwt (the header kid selects the key; without one every key is tried), well-formed claims, sub === expectedUri, iat not after now + skew, age now - iat not above maxAgeSeconds (an age equal to it passes), exp not reached (now >= exp + skew is stale), then bits and an lst that inflates within the size limit. All token problems are reported as STATUS_LIST_INVALID except the two freshness rules, which are STATUS_LIST_STALE. A list found in cache skips the signature check and the inflation but goes through the same sub, iat, age and exp checks. Errors that are not about the token (an unavailable crypto backend) and non-finite now, maxAgeSeconds or skewSeconds are thrown.

      Parameters

      • token: string
      • i: {
            cache?: StatusListCache;
            crypto?: CryptoProvider;
            expectedUri: string;
            keys: readonly EcPublicJwk[];
            maxAgeSeconds: number;
            now: number;
            skewSeconds?: number;
        }

      Returns Promise<
          | { ageSeconds: number; list: ParsedStatusList; ok: true }
          | { ok: false; reason: "STATUS_LIST_STALE" | "STATUS_LIST_INVALID" },
      >