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

Presentation signer is did:key but VC subject ID is did:jwk: how to validate PoP? #166

Open
reinkrul opened this issue Oct 18, 2023 · 1 comment

Comments

@reinkrul
Copy link

While testing OpenID4VP with the Sphereon wallet, I noticed that the signer of the JWT (vp_token) is a did:key DID (from the mobile wallet), while the holder (credentialSubject.id) of the contained VC is a did:jwk. How would one ever validate that the signer possesses the private key of the credential subject, if signer != credential subject? Or am I missing something here?

In the example below, the signer of the VP is did:key:z6MksEyx6d5pB1ekoaVmaGsibbcYHE9Vxx7V13PSqPwxYRzL (ed25519 key) and the subject of the VC is did:jwk:eyJhbGciOiJFUzI1NksiLCJ1c2UiOiJzaWciLCJrdHkiOiJFQyIsImNydiI6InNlY3AyNTZrMSIsIngiOiJjMVdYczdXM215c2VVZk5CcXN4ZFBXQklHaEtkNFR6MExSLUZqOEZNWWEwIiwieSI6Ildta0NYdTF3eXpaZ0dON1V4TmFwcHFuT1FhT2tXMkNnT1NuT295TUlUdWMifQ (secp256k1 key).

JWT:

eyJraWQiOiJkaWQ6a2V5Ono2TWtzRXl4NmQ1cEIxZWtvYVZtYUdzaWJiY1lIRTlWeHg3VjEzUFNxUHd4WVJ6TCN6Nk1rc0V5eDZkNXBCMWVrb2FWbWFHc2liYmNZSEU5Vnh4N1YxM1BTcVB3eFlSekwiLCJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJ2cCI6eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy92MSIsImh0dHBzOi8vaWRlbnRpdHkuZm91bmRhdGlvbi9wcmVzZW50YXRpb24tZXhjaGFuZ2Uvc3VibWlzc2lvbi92MSJdLCJ0eXBlIjpbIlZlcmlmaWFibGVQcmVzZW50YXRpb24iLCJQcmVzZW50YXRpb25TdW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p0bTFVeTNUbDZSelVPTTZNalAzdlEiXX0sInByZXNlbnRhdGlvbl9zdWJtaXNzaW9uIjp7ImlkIjoidG9DdGp5Y0V3QlZCWVBsbktBQTZGIiwiZGVmaW5pdGlvbl9pZCI6InNwaGVyZW9uIiwiZGVzY3JpcHRvcl9tYXAiOlt7ImlkIjoiNGNlN2FmZjEtMDIzNC00ZjM1LTlkMjEtMjUxNjY4YTYwOTUwIiwiZm9ybWF0Ijoiand0X3ZjIiwicGF0aCI6IiQudmVyaWZpYWJsZUNyZWRlbnRpYWxbMF0ifV19LCJuYmYiOjE2OTU5OTU2MzYsImlzcyI6ImRpZDprZXk6ejZNa3NFeXg2ZDVwQjFla29hVm1hR3NpYmJjWUhFOVZ4eDdWMTNQU3FQd3hZUnpMIn0.w3guHX-pmxJGGn5dGSSIKSba9xywnOutDk-l3tc_bpgHEOSbcR1mmmCqX5sSlZM_G0hgAbgpIv_YYI5iQNIfCw

Decoded JWT headers:

{
  "kid": "did:key:z6MksEyx6d5pB1ekoaVmaGsibbcYHE9Vxx7V13PSqPwxYRzL#z6MksEyx6d5pB1ekoaVmaGsibbcYHE9Vxx7V13PSqPwxYRzL",
  "alg": "EdDSA",
  "typ": "JWT"
}

Decoded VC:

{
  "exp": 1696301708,
  "vc": {
    "@context": [
      "https://www.w3.org/2018/credentials/v1"
    ],
    "type": [
      "VerifiableCredential",
      "GuestCredential"
    ],
    "credentialSubject": {
      "firstName": "Hello",
      "lastName": "Sphereon",
      "email": "sphereon@example.com",
      "type": "Sphereon Guest",
      "id": "did:jwk:eyJhbGciOiJFUzI1NksiLCJ1c2UiOiJzaWciLCJrdHkiOiJFQyIsImNydiI6InNlY3AyNTZrMSIsIngiOiJjMVdYczdXM215c2VVZk5CcXN4ZFBXQklHaEtkNFR6MExSLUZqOEZNWWEwIiwieSI6Ildta0NYdTF3eXpaZ0dON1V4TmFwcHFuT1FhT2tXMkNnT1NuT295TUlUdWMifQ"
    }
  },
  "@context": [
    "https://www.w3.org/2018/credentials/v1"
  ],
  "type": [
    "VerifiableCredential",
    "GuestCredential"
  ],
  "expirationDate": "2023-10-03T02:55:08.133Z",
  "credentialSubject": {
    "firstName": "Hello",
    "lastName": "Sphereon",
    "email": "sphereon@example.com",
    "type": "Sphereon Guest",
    "id": "did:jwk:eyJhbGciOiJFUzI1NksiLCJ1c2UiOiJzaWciLCJrdHkiOiJFQyIsImNydiI6InNlY3AyNTZrMSIsIngiOiJjMVdYczdXM215c2VVZk5CcXN4ZFBXQklHaEtkNFR6MExSLUZqOEZNWWEwIiwieSI6Ildta0NYdTF3eXpaZ0dON1V4TmFwcHFuT1FhT2tXMkNnT1NuT295TUlUdWMifQ"
  },
  "issuer": "did:jwk:eyJhbGciOiJFUzI1NiIsInVzZSI6InNpZyIsImt0eSI6IkVDIiwiY3J2IjoiUC0yNTYiLCJ4IjoiVEcySDJ4MmRXWE4zdUNxWnBxRjF5c0FQUVZESkVOX0gtQ010YmdqYi1OZyIsInkiOiI5TThOeGQwUE4yMk05bFBEeGRwRHBvVEx6MTV3ZnlaSnM2WmhLSVVKMzM4In0",
  "issuanceDate": "2023-09-29T12:31:08.133Z",
  "sub": "did:jwk:eyJhbGciOiJFUzI1NksiLCJ1c2UiOiJzaWciLCJrdHkiOiJFQyIsImNydiI6InNlY3AyNTZrMSIsIngiOiJjMVdYczdXM215c2VVZk5CcXN4ZFBXQklHaEtkNFR6MExSLUZqOEZNWWEwIiwieSI6Ildta0NYdTF3eXpaZ0dON1V4TmFwcHFuT1FhT2tXMkNnT1NuT295TUlUdWMifQ",
  "nbf": 1695990668,
  "iss": "did:jwk:eyJhbGciOiJFUzI1NiIsInVzZSI6InNpZyIsImt0eSI6IkVDIiwiY3J2IjoiUC0yNTYiLCJ4IjoiVEcySDJ4MmRXWE4zdUNxWnBxRjF5c0FQUVZESkVOX0gtQ010YmdqYi1OZyIsInkiOiI5TThOeGQwUE4yMk05bFBEeGRwRHBvVEx6MTV3ZnlaSnM2WmhLSVVKMzM4In0"
}
@nklomp
Copy link
Contributor

nklomp commented Oct 18, 2023

Thanks for reporting. This is indeed a bug in latest version. Should be fixed in a new release which will have preliminary support for oid4vp v18 as well

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

No branches or pull requests

2 participants