Skip to content

fix: separate parsing logic of VCDM2.0 and SD-JWT VC Credentials#692

Merged
nanderstabel merged 26 commits intodevfrom
fix/vcdm2
Mar 3, 2026
Merged

fix: separate parsing logic of VCDM2.0 and SD-JWT VC Credentials#692
nanderstabel merged 26 commits intodevfrom
fix/vcdm2

Conversation

@nanderstabel
Copy link
Copy Markdown
Contributor

@nanderstabel nanderstabel commented Feb 3, 2026

Description of change

This change separates the parsing of VCDM2 SD-JWTs (vc+sd-jwt) from SD-JWT VCs (dc+sd-jwt), and prevents the error below (the vct claim is REQUIRED in SD-JWT VC but not for SD-JWT secured VCDM2 Credentials).

#[test]
fn test() {
    let test = "eyJ0eXAiOiJ2YytzZC1qd3QiLCJraWQiOiJkaWQ6d2ViOmxvY2FsaG9zdCUzQTMwMzMjQXM1cjRVeG9fWjREV19XLW9BUVNURTRLT1hhMnVWeUJRYUNna3VTUkhwWSIsImFsZyI6IkVTMjU2In0.eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvbnMvY3JlZGVudGlhbHMvdjIiXSwidHlwZSI6WyJWZXJpZmlhYmxlQ3JlZGVudGlhbCJdLCJjcmVkZW50aWFsU3ViamVjdCI6eyJfc2QiOlsiVk5BZUVsM0d1YnVrQWx0TVNRUEhJZ25qcm9XckZ6eDd5NW5lQkgxV19vOCIsIl9UZ3owMmhiYmJKbzBUM2NFV3BRbkh4WjNxZGdLcDZyd2w1Ri1PeW5NN0kiLCJ5MnhKZ01NQjJOajVqQ09idXpBWVNiaXZYWncwRmg4VmN2UzlzeTlrQUZnIl19LCJpc3N1ZXIiOnsiaWQiOiJodHRwOi8vbG9jYWxob3N0OjMwMzMvIiwibmFtZSI6IlVuaUNvcmUifSwidmFsaWRGcm9tIjoiMjAyNi0wMi0wM1QyMDo0OTo1MloiLCJjcmVkZW50aWFsU3RhdHVzIjp7ImlkIjoiaHR0cDovL2xvY2FsaG9zdDozMDMzL2lldGYtb2F1dGgtdG9rZW4tc3RhdHVzLWxpc3QvMCIsIn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rap()` on an `Err` value: MissingClaim("vct")

Links to any relevant issues

How the change has been tested

  • Updated the test_verifiable_credential_record_try_from_sd_jwt_vc test
  • Added the test_verifiable_credential_record_try_from_vcdm2_sd_jwt test
  • Validated that all test pass in the ITB DIIPv5 Test Suite

Definition of Done checklist

Add an x to the boxes that are relevant to your changes.

  • I have followed the contribution guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@nanderstabel nanderstabel self-assigned this Feb 3, 2026
@nanderstabel nanderstabel added the Bug Something isn't working label Feb 3, 2026
@nanderstabel nanderstabel changed the title fix: separate SdJwtVcand SdJwt credentials fix: separate parsing logic of VCDM2.0 and SD-JWT VC Credentials Feb 3, 2026
@nanderstabel nanderstabel marked this pull request as ready for review February 3, 2026 21:13
Copy link
Copy Markdown
Contributor

@Oran-Dan Oran-Dan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I havent reviewed the tests yet as I would first like to discuss/address the current comments

Comment thread identity-wallet/src/state/credentials/mod.rs Outdated
Comment thread identity-wallet/src/state/credentials/mod.rs Outdated
Comment thread identity-wallet/src/state/credentials/mod.rs Outdated
Comment thread identity-wallet/src/state/credentials/mod.rs Outdated
Comment thread identity-wallet/src/state/credentials/mod.rs Outdated
Comment thread identity-wallet/src/state/credentials/mod.rs Outdated
Comment thread identity-wallet/src/state/credentials/mod.rs Outdated
Comment thread identity-wallet/src/state/credentials/mod.rs Outdated
Comment thread identity-wallet/src/state/credentials/mod.rs
@nanderstabel nanderstabel changed the base branch from dev to build/diipv5 February 22, 2026 12:13
Oran-Dan
Oran-Dan previously approved these changes Feb 26, 2026
Copy link
Copy Markdown
Contributor

@Oran-Dan Oran-Dan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesomesauce

daniel-mader
daniel-mader previously approved these changes Feb 28, 2026
Base automatically changed from build/diipv5 to dev March 2, 2026 11:36
@nanderstabel nanderstabel dismissed stale reviews from daniel-mader and Oran-Dan March 2, 2026 11:36

The base branch was changed.

@nanderstabel nanderstabel merged commit cf453ac into dev Mar 3, 2026
1 of 3 checks passed
@nanderstabel nanderstabel deleted the fix/vcdm2 branch March 3, 2026 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants