sdjwt_oid4vc 0.1.3
sdjwt_oid4vc: ^0.1.3 copied to clipboard
SD-JWT VC + OpenID4VCI/OpenID4VP protocol library for Dart wallets (holder role). Key- and HTTP-agnostic, pure logic, fully testable without hardware.
Changelog #
0.1.3 #
- Metadata only, no code changes.
homepagenow points at the design write-up (https://exilonx.github.io/case-study/sdjwt-oid4vc);repositoryis unchanged.
0.1.2 #
- Nested-claim DCQL matching —
match/satisfiesRequestnow check requested claim paths (nested["place_of_birth","locality"], array["nationalities", 0], and the[…, null]all-elements wildcard) against the reconstructed claim tree, not just top-level names. Presenting those paths already worked (present(disclosePaths:)); matching no longer falsely accepts a request for a nested claim the credential lacks.
0.1.1 #
OpenID4VP direct_post.jwt — encrypted authorization responses. Closes the
presentation leg against OpenID4VP 1.0-Final verifiers (e.g. the EUDI reference),
which require the vp_token to be POSTed as an encrypted JWE, not a plaintext
form field. All additive; the plain direct_post path is unchanged.
Oid4vpClient.present(req, match, signer)— one call that builds the KB-JWT-bound presentation, assembles the 1.0-finalvp_token, and submits it in whateverresponse_modethe request asked for (encrypting fordirect_post.jwt).Oid4vpClient.submitResponse(req, vpToken)— response-mode-aware submit;buildVpTokenMap(...)builds the 1.0-final{queryId: [presentation]}shape. Failed submits now include the verifier's response body.PresentationRequest.responseEncryption(ResponseEncryption) — the verifier's ephemeraluse:enckey + chosenenc, parsed fromclient_metadata(1.0-final;ECDH-ESdirect,A128GCM/A256GCM).- New internal
core/jwe.dart: an ECDH-ES (direct) + Concat-KDF + AES-GCM compact-JWE encrypter (pointycastle; the only place the library generates a key). Verified against the RFC 7518 Appendix C Concat-KDF vector.
0.1.0-dev.2 #
No library changes since dev.1. This release validates the automated,
tag-triggered pub.dev publish pipeline (OIDC) end-to-end — dev.1 was published
by hand.
0.1.0-dev.1 #
First pre-release. Security hardening and the features a general-purpose wallet needs before production. All additive — existing call sites keep working.
- Hardening (sdjwt/core) —
verifyIssuernow asserts the issuer JWTalg/typbefore any key work (key resolution shared via a new internalissuer_verifier);resolveClaimsbounds nesting depth and rejects duplicate disclosure digests and disclosed/clear claim collisions; all fetched URLs (metadata, JWKS, status lists, offers, request objects) must behttps(loopbackhttpallowed for dev). - Issuer chain validation — new
IssuerTrust.x5cChain(trustAnchors)mode validates thex5cchain (each link's ECDSA-SHA256 signature, every certificate's validity window, and anchoring to a caller-supplied trust anchor) before verifying with the leaf key. The Trusted List itself (the EU LOTL — which anchors) is app-provided; revocation (CRL/OCSP) and name/policy constraints remain out of scope. - Validity —
notBefore/isNotYetValid/isValid(At)getters, and an optionalenforceValidityonverifyIssuerthat folds thenbf..expwindow into the result. - RP authentication (oid4vp) —
PresentationRequest.signaturenow exposes the request object's signing material (x5c,alg,kid, signing input) withverifyWithX5cLeaf()/verifyWithJwk()helpers, plusclientIdScheme/clientIdValue. The wallet still owns the trust decision. - Revocation —
StatusListResolver+StatusListRef/CredentialStatusresolve a credential's Token Status List entry (fetch, optional signature verification, zlib inflate, bit read).SdJwtVc.statusListRefexposes the reference. Adds anarchivedependency for zlib inflate. - Multi-credential DCQL — parses
credential_sets;matchAll,satisfiesRequest, andbuildVpTokenObjecthandle requests for several credentials at once. - Nested presentation —
presentgainsdisclosePaths(full DCQL claim paths, including nested objects, array indices, and thenull"all elements" wildcard), pulling in each path's ancestor disclosures. - Dependency —
pointycastlewidened to>=3.9.1 <5.0.0(was^4.0.0). The library uses only stable 3.9+ primitives, so a wallet pinned to pointycastle 3.9.x (e.g. for PDF signing / NFC) resolves it with no dependency override. Verified on both 3.9.1 and 4.0.0; a CI job pins the floor.
0.1.0-dev.1 (unreleased) #
Initial implementation of the holder/wallet protocol stack.
- core — injected
Es256SignerandOid4vcHttpcontracts,DefaultOid4vcHttp, ES256 (P-256) verification with key resolution from JWK orx5c, RFC 7638 JWK thumbprint, base64url, compact-JWS helpers, injectable clock, sealedOid4vcErrorhierarchy. - sdjwt — SD-JWT VC codec: parse,
resolveClaims(nested objects + array disclosures),verifyIssuer(x5csignature-only orjwt-vc-issuermetadata),present(selective disclosure + KB-JWT), andissue(for tests). - oid4vci —
Oid4vciClientfor the pre-authorized-code flow:parseOffer,fetchIssuerMetadata,requestToken,requestNonce,buildProof,requestCredential,redeemOffer. - oid4vp —
Oid4vpClient:fetchRequest/parseRequest, DCQLmatch,buildVpToken,submit. - testing —
SoftwareEs256Signer(real in-memory P-256 key) underpackage:sdjwt_oid4vc/testing.dart. - Test suite at 100% line coverage;
dart analyzeclean under strict lints.