Skip to content
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

Update vcjwt test vector to use did:jwk instead of did:key #150

Merged
merged 1 commit into from
Apr 5, 2024

Conversation

KendallWeihe
Copy link
Contributor

The valid VC-JWT in the verify test vector contained within it a did:key but we don't formally support did:key in golang so I recreated it using a did:jwk

  • ✅ tested in web5-js
  • ✅ tested in web5-kt
  • ⚠️ not tested in web5-swift because web5-swift does not consume this test vector

Old decoded

{
  "typ": "JWT",
  "alg": "EdDSA",
  "kid": "did:key:z6MkmkZxiBZxdCwKtcD1hnpKvYou8HpV8J2x1L1y9HeGnPJJ#z6MkmkZxiBZxdCwKtcD1hnpKvYou8HpV8J2x1L1y9HeGnPJJ"
}
{
  "vc": {
    "@context": [
      "https://www.w3.org/2018/credentials/v1"
    ],
    "type": [
      "VerifiableCredential",
      "TBDeveloperCredential"
    ],
    "id": "urn:uuid:2fcf4d34-e797-41be-abe7-a01df9283748",
    "issuer": "did:key:z6MkmkZxiBZxdCwKtcD1hnpKvYou8HpV8J2x1L1y9HeGnPJJ",
    "issuanceDate": "2024-02-29T18:16:14Z",
    "credentialSubject": {
      "id": "did:key:z6MkuqGT29CLtYweefrNeU8Y8rvzmpiMi7wp2MiBAoRBkbfk",
      "username": "nitro"
    }
  },
  "nbf": 1709230574,
  "jti": "urn:uuid:2fcf4d34-e797-41be-abe7-a01df9283748",
  "iss": "did:key:z6MkmkZxiBZxdCwKtcD1hnpKvYou8HpV8J2x1L1y9HeGnPJJ",
  "sub": "did:key:z6MkuqGT29CLtYweefrNeU8Y8rvzmpiMi7wp2MiBAoRBkbfk",
  "iat": 1709230574,
  "exp": 2697821763
}

New decoded

{
  "alg": "EdDSA",
  "kid": "did:jwk:eyJrdHkiOiJPS1AiLCJjcnYiOiJFZDI1NTE5IiwieCI6ImRRRm8ybUo1elRRUndlTTdIS0NOaTN2UzlkNE1LZ2J4MHZPUDhzSEJJOEUifQ#0",
  "typ": "JWT"
}
{
  "iss": "did:jwk:eyJrdHkiOiJPS1AiLCJjcnYiOiJFZDI1NTE5IiwieCI6ImRRRm8ybUo1elRRUndlTTdIS0NOaTN2UzlkNE1LZ2J4MHZPUDhzSEJJOEUifQ",
  "jti": "urn:vc:uuid:6423921c-7613-43b0-9ea2-b90613a03057",
  "nbf": 1712236726,
  "sub": "did:jwk:eyJrdHkiOiJPS1AiLCJjcnYiOiJFZDI1NTE5IiwieCI6ImRRRm8ybUo1elRRUndlTTdIS0NOaTN2UzlkNE1LZ2J4MHZPUDhzSEJJOEUifQ",
  "vc": {
    "@context": [
      "https://www.w3.org/2018/credentials/v1"
    ],
    "type": [
      "VerifiableCredential",
      "TBDeveloperCredential"
    ],
    "issuer": "did:jwk:eyJrdHkiOiJPS1AiLCJjcnYiOiJFZDI1NTE5IiwieCI6ImRRRm8ybUo1elRRUndlTTdIS0NOaTN2UzlkNE1LZ2J4MHZPUDhzSEJJOEUifQ",
    "credentialSubject": {
      "id": "did:jwk:eyJrdHkiOiJPS1AiLCJjcnYiOiJFZDI1NTE5IiwieCI6ImRRRm8ybUo1elRRUndlTTdIS0NOaTN2UzlkNE1LZ2J4MHZPUDhzSEJJOEUifQ",
      "username": "nitro"
    },
    "id": "urn:vc:uuid:6423921c-7613-43b0-9ea2-b90613a03057",
    "issuanceDate": "2024-04-04T13:18:46Z"
  }
}

@nitro-neal
Copy link
Contributor

Awesome! Thanks for testing in other repos

@KendallWeihe KendallWeihe merged commit cb66211 into main Apr 5, 2024
1 check passed
@KendallWeihe KendallWeihe deleted the kendall/vcjwt-verify-didjwk branch April 5, 2024 13:42
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.

3 participants