UMIS SDK
    Preparing search index...

    Function verifyKeyBinding

    • Checks the key-binding JWT of a presentation (RFC 9901 sections 4.3 and 7.3), in this order, stopping at the first failure: the JWT is present, has typ kb+jwt and no header members beyond alg and typ, carries iat, aud, nonce and sd_hash, is signed by the credential's cnf.jwk, and its sd_hash covers exactly the issuer JWT and the disclosures received (all HOLDER_BINDING_INVALID); then the nonce (NONCE_MISMATCH; without an expected nonce any value of at least 22 base64url characters passes and is returned so that the caller can record it), the audience (AUDIENCE_MISMATCH), an iat more than skewSeconds ahead of now or before notBefore - skewSeconds (CLOCK_SKEW), and an age above maxAgeSeconds (PRESENTATION_EXPIRED).

      Parameters

      • p: ParsedSdJwt
      • c: {
            aud: string | readonly string[];
            crypto?: CryptoProvider;
            maxAgeSeconds: number;
            nonce?: string;
            notBefore?: number;
            now: number;
            skewSeconds: number;
        }

      Returns Promise<
          | { iat: number; nonce: string; ok: true }
          | { ok: false; reason: KeyBindingReason },
      >