Build the OID4VCI holder key proof of possession
(draft-ietf-oauth-openid4vci §8.2.1.1), the wallet-side mirror of
Attesto.CredentialProof.verify_jwt/2.
A proof is a JWT, typed openid4vci-proof+jwt, whose header carries the
holder's public key (as jwk) and whose payload proves the wallet holds
the matching private key at request time:
aud- the Credential Issuer Identifier (:credential_issuer).iat- issuance time.nonce- thec_noncethe issuer previously handed out, when it did.iss- theclient_id, required for the authorization_code flow.
Signing and key-bound :alg/:kid validation behave as in
AttestoClient.RequestObject / AttestoClient.ClientAssertion (shared
AttestoClient.Builder internals).
Summary
Functions
Build a signed holder key proof, returning {:ok, compact_jws} or
{:error, reason}. Fails fast on invalid input (see the error type).
Types
@type error() :: :invalid_key | :invalid_credential_issuer | :invalid_time | :unsupported_alg | :unsupported_key | {:signing_failed, String.t()}
@type jwk() :: JOSE.JWK.t() | map()
Functions
Build a signed holder key proof, returning {:ok, compact_jws} or
{:error, reason}. Fails fast on invalid input (see the error type).
jwk is the holder's key (private half required for signing). Required
option: :credential_issuer (the proof's aud). Pass :nonce with the
issuer's c_nonce when it supplied one, and :client_id for the
authorization_code flow (becomes iss); :alg, :kid, and :now behave
as in AttestoClient.RequestObject.build/2. Pass :key_attestation (a
compact JWT from AttestoClient.KeyAttestation.build/2) to carry it in the
proof's key_attestation header, vouching that this key is securely stored.