UMIS SDK
    Preparing search index...

    Function verifyKeyProof

    • Verifies the key proof of a credential request (OpenID4VCI 1.0 section 8.2, appendix F.1) and returns the key that the credential is to be bound to.

      The proof is a JWT with the exact typ openid4vci-proof+jwt and alg ES256, signed by the public key in its jwk header; the header has neither kid nor x5c, and the jwk has no private member. In the payload aud equals (or contains) audience, the nonce is the expected one, and iat lies within [now - maxAgeSeconds, now + 60] (maxAgeSeconds is 300 unless given).

      A nonce that differs is invalid_nonce; every other failure, a missing nonce included (section 8.3.1.2), is invalid_proof. Whatever is wrong with proofJwt is reported, never thrown. Remembering the nonce and using it up is up to the caller.

      Parameters

      • i: {
            audience: string;
            crypto?: CryptoProvider;
            maxAgeSeconds?: number;
            nonce: string;
            now: number;
            proofJwt: string;
        }

      Returns Promise<KeyProofResult>