Skip to content

About

OpenID4VP 1.0 verifier and headless wallet in Rust (SD-JWT VC, DCQL, HAIP), exercised against the OpenID Foundation conformance suite run locally

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

oid4vc-conformance

A small Rust implementation of the verifiable-credential protocols used by the EU Digital Identity Wallet, exercised against the OpenID Foundation conformance suite run locally.

  • crates/sdjwt: SD-JWT (RFC 9901) and SD-JWT VC: disclosures, key binding (KB-JWT), x5c chains, ES256.
  • crates/dcql: DCQL query evaluation over held credentials.
  • crates/verifier: OpenID4VP 1.0 verifier. Plain profile (redirect_uri, direct_post) and HAIP (x509_hash, signed request objects by request_uri GET and POST, direct_post.jwt with ECDH-ES).
  • crates/wallet: headless OpenID4VP 1.0 holder: request authentication, DCQL selection, key binding, plain and encrypted responses, and the rejections the wallet plans check.
  • harness/, tools/: the pinned, prebuilt suite in Docker, plan configurations, a runner wrapper and an evidence export with hashes.

Protocol logic is written from primitives (p256, sha2, aes-gcm, x509-cert); no identity framework. #![forbid(unsafe_code)], no unwrap outside tests, pinned dependencies.

Status

Reference implementation. Not audited, not a product, not certified. Certification is a separate, hosted, paid process of the OpenID Foundation that has not been done. Everything below was run on the locally hosted suite 5.3.1 (source 440eec8, image digests in harness/SUITE.lock).

Plan (1.0 Final, sd_jwt_vc) Modules Result
Verifier, plain 11 7 PASSED, 4 REVIEW, 0 FAILED
Verifier, HAIP 11 7 PASSED, 4 REVIEW, 0 FAILED (588 SUCCESS conditions, 0 FAILURE)
Wallet, HAIP 15 12 PASSED, 3 INTERRUPTED, 0 FAILED
Wallet, plain (alpha plan, not part of the certification programme) 15 10 PASSED, 2 FAILED, 3 INTERRUPTED

No whole plan is claimed green. REVIEW and INTERRUPTED are modules where the suite asks a human to upload a screenshot (the verifier's result page, or the wallet's rejection); the headless drivers upload nothing and leave those verdicts as they are. The two plain wallet failures happen inside the suite's request construction before the wallet is contacted; see docs/RESULTS.md and ADR-007 in docs/DECISIONS.md. Exact variants, plan ids and hashes are in RESULTS; per-run manifests are under evidence/. Commit hashes inside the manifests refer to the development history, which is not part of this repository.

Not implemented: credential issuance (OpenID4VCI), mdoc / ISO 18013-5, the Digital Credentials API, production key management, any user interface.

Running the harness

The suite UI is at https://localhost.emobix.co.uk:8443/. It runs in development mode without accounts. The proxy exposes ports 8443 and 8444 on 127.0.0.1 only. Its development TLS certificate is not installed into the operating system.

powershell -ExecutionPolicy Bypass -File tools\conformance.ps1 --list
powershell -ExecutionPolicy Bypass -File tools\conformance.ps1 suite-selftest --runner-list
powershell -ExecutionPolicy Bypass -File tools\conformance.ps1 suite-selftest
powershell -ExecutionPolicy Bypass -File tools\conformance.ps1 suite-smoke-id3
powershell -ExecutionPolicy Bypass -File tools\conformance.ps1 vp-verifier-plain
powershell -ExecutionPolicy Bypass -File tools\conformance.ps1 vp-verifier-haip
powershell -ExecutionPolicy Bypass -File tools\conformance.ps1 vp-wallet-plain
powershell -ExecutionPolicy Bypass -File tools\conformance.ps1 vp-wallet-haip
powershell -ExecutionPolicy Bypass -File tools\down.ps1

The wrapper starts only this project's Compose services, waits for the UI and API, checks the running source revision and image identities, generates local throwaway test keys, and calls the upstream run-test-plan.py without modifying it. It will shallow-fetch the exact source commit if harness/suite-src/ is absent. Python packages must already match harness/SUITE.lock; nothing is installed automatically. The suite source is used for the runner, examples and test PKI generator, never built.

suite-selftest selects the 1.0 Final verifier and wallet happy-flow modules. On the pinned suite the verifier finishes as REVIEW, which makes this wrapper return 1 even though the upstream runner returns 0. The wallet module passes. The suite's source explicitly requires review of verification screenshots; the harness does not convert that result to a pass.

vp-verifier-plain runs the whole oid4vp-1final-verifier-test-plan with vp_profile=plain_vp, credential_format=sd_jwt_vc, client_id_prefix=redirect_uri, request_method=url_query, response_mode=direct_post. The local Rust verifier accepts the four positive cases and immediately rejects the seven negative cases. The suite reports 7 PASSED / 4 REVIEW, so the wrapper exits 1 and Phase 2's green-plan requirement remains open. No positive module is relabeled as passing.

vp-verifier-haip runs the whole oid4vp-1final-verifier-haip-test-plan, selecting credential_format=sd_jwt_vc, response_mode=direct_post.jwt; the plan fixes vp_profile=haip, client_id_prefix=x509_hash, request_method=request_uri_signed on every module. Signed requests are exercised via GET, repeat GET and POST with wallet nonce. The result is also 7 PASSED / 4 REVIEW, with the four successful redirects checked separately by the local driver. Phase 3's green-plan requirement remains open; see ADR-006.

Both verifier aliases build the service with cargo build --locked --offline, start it with temporary TLS and issuer trust on loopback, and start a separate callback bridge from the pinned official nginx image in this project's Compose profile. The bridge exposes /direct_post, opaque /request_uri/<id> and /results/<receipt> paths to the local suite network and publishes no host port. The Rust process and bridge stop after the run; the suite remains available for inspection. The suite's own configuration and source stay unchanged. Run cargo fetch --locked first if the pinned Rust dependencies are not cached.

The wallet aliases run the whole reachable SD-JWT plans using EUDI PID test data. Plain selects vp_profile=plain_vp, credential_format=sd_jwt_vc, credential_type=eudi_pid, client_id_prefix=redirect_uri, request_method=request_uri_unsigned, response_mode=direct_post. HAIP selects credential_format=sd_jwt_vc, credential_type=eudi_pid, response_mode=direct_post.jwt; the plan fixes vp_profile=haip, client_id_prefix=x509_hash, request_method=request_uri_signed. The suite's own browser calls the capability-protected wallet endpoint through a separate project bridge, including the actual success redirect. The wallet pins the locally captured suite TLS certificate and restricts outbound requests to that configured loopback origin. Keys and test credentials are temporary.

Wallet results are 10 PASSED / 2 FAILED / 3 INTERRUPTED without a result for plain, and 12 PASSED / 3 INTERRUPTED without a result for HAIP. Both wrappers exit 1. Two plain modules fail inside the pinned suite's request construction; three rejection modules per profile require screenshots that this headless holder does not provide. No executed module is skipped or relabeled. Phase 4 therefore does not meet the whole-plan green requirement; exact results are in RESULTS and ADR-007. No green 1.0 Final wallet plan is claimed.

suite-smoke-id3 selects the upstream ID3 verifier/wallet happy-flow pairing as an equivalent infrastructure smoke. Both selected modules pass locally. This tests the runner, HTTP exchange and archive/evidence path; it makes no claim about the 1.0 Final plans or this project's Rust implementation. Exact variants, digests and results are in docs/RESULTS.md.

Each run records evidence/<UTC timestamp>-<alias>/RUN.json and its SHA-256. The manifest includes the actual module results, unselected modules, plan IDs, suite digests/revision, repository commit/dirty state and input-file hashes. Original suite ZIP exports and generated configs stay under the ignored raw/ directory: they contain throwaway credentials and keys. Terminal and runner logs retain only status diagnostics. Preserve the local raw/ folders for archive verification.

python tools\verify_evidence.py evidence\<run>\RUN.json --check-inputs
cargo fmt --check
cargo clippy --all-targets -- -D warnings
cargo test
cargo audit
python -m unittest discover -s tools -p 'test_*.py' -v

verify_evidence.py checks local hashes and archive verdicts offline; exit 0 means integrity verified, including for a faithfully recorded non-passing run. It does not validate the suite's archive signatures. --check-inputs additionally compares the current harness files to the run's input hashes. Service runs also hash the Rust source, Cargo manifests/lockfile and the built executable.

down.ps1 removes this project's containers, two networks and database volume. It retains downloaded images, source, local PKI and evidence files. It refuses teardown during a harness run. An interrupted process can leave harness/runtime/run.lock; inspect its PID before manually deleting a stale lock. No command prunes Docker or changes other projects' containers.

See docs/DECISIONS.md for the source/plan discrepancies.

License

MIT. The conformance suite is a separate project under its own licence (harness/UPSTREAM-LICENSE.txt); it is pulled at run time, not vendored.

About

OpenID4VP 1.0 verifier and headless wallet in Rust (SD-JWT VC, DCQL, HAIP), exercised against the OpenID Foundation conformance suite run locally

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages