Skip to content

Rewrite SD-JWT routines. #1021

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 3, 2025
Merged

Rewrite SD-JWT routines. #1021

merged 1 commit into from
Jun 3, 2025

Conversation

davidz25
Copy link
Contributor

@davidz25 davidz25 commented Jun 2, 2025

Our current SD-JWT implementation only supports disclosures at the top-level, rewrite this to support disclosures at any level including full recursion. This is needed to support a verifier asking for e.g. ['address' 'street_address'] given e.g. the EU PID document type from ARF 1.8 and onwards.

Also add comprehensive testing against the test vectors in the SD-JWT specification. The new implementation is intended to target low-level SD-JWTs instead of the higher SD-JWT VC which the old implementation targeted. As such, it only contains two classes, SdJwt and SdJwtKb.

Replace JsonWebKey with methods on EcPublicKey and also use existing JsonWebSignature support routines instead of JwtObject, JwtHeader, JwtBody classes. Rewrite JsonWebSignature to not use nimbus at runtime (thus making it multiplatform) but retain the nimbus tests in the JVM specific tests, to ensure interoperability. Also add the functionality to sign with a SecureArea.

Port all code to use these new SD-JWT routines.

A few changes to VcClaim and VcRequestedClaim are still needed to fully support non-top-level claims. A future PR will address that, this PR lays the groundwork for that change.

Test: ./gradlew check && ./gradlew connectedCheck
Test: Manually tested VerifierServlet against samples/testapp

@davidz25 davidz25 requested a review from sorotokin June 2, 2025 20:16
@davidz25 davidz25 force-pushed the sdjwt-work branch 6 times, most recently from cea8646 to c4f828d Compare June 2, 2025 22:57
Our current SD-JWT implementation only supports disclosures at the
top-level, rewrite this to support disclosures at any level including
full recursion. This is needed to support a verifier asking for
e.g. `['address' 'street_address']` given e.g. the EU PID document
type from ARF 1.8 and onwards.

Also add comprehensive testing against the test vectors in the SD-JWT
specification. The new implementation is intended to target low-level
SD-JWTs instead of the higher SD-JWT VC which the old implementation
targeted. As such, it only contains two classes, `SdJwt` and
`SdJwtKb`.

Replace `JsonWebKey` with methods on `EcPublicKey` and also use
existing `JsonWebSignature` support routines instead of `JwtObject`,
`JwtHeader`, `JwtBody` classes. Rewrite `JsonWebSignature` to not use
nimbus at runtime (thus making it multiplatform) but retain the nimbus
tests in the JVM specific tests, to ensure interoperability. Also add
the functionality to sign with a `SecureArea`.

Port all code to use these new SD-JWT routines.

A few changes to `VcClaim` and `VcRequestedClaim` are still needed to
fully support non-top-level claims. A future PR will address that,
this PR lays the groundwork for that change.

Test: ./gradlew check && ./gradlew connectedCheck
Test: Manually tested VerifierServlet against samples/testapp
Signed-off-by: David Zeuthen <[email protected]>
@davidz25 davidz25 merged commit 2595ee0 into main Jun 3, 2025
6 checks passed
@davidz25 davidz25 deleted the sdjwt-work branch June 3, 2025 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants