You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Credentials issued by did:peer fail verification.
Here is a sample test to reproduce the issue:
// using an agent with `@veramo/did-provider-peer#PeerDIDProvider`// and `@veramo/did-provider-peer#getResolver`// did:peer uses publicKeyMultibaseconstissuer=awaitagent.didManagerCreate({provider: 'did:peer',options: {num_algo: 0}})constpayload={issuer: issuer.did,credentialSubject: {nothing: 'else matters',},}constcredential=awaitagent.createVerifiableCredential({credential: payload,proofFormat: 'jwt',})constverifyResult=awaitagent.verifyCredential({ credential })expect(verifyResult.verified).toBeTruthy()
Details
It seems that the publicKeyMultibase is a multibase encoding of a multicodec encoding of an ed25519 public key. did-jwt@7.2.5 doesn't know how to interpret the multicodec encoding so it tries to use the byte array as is so verification fails.
The fix would be in the did-jwt library.
Versions (please complete the following information):
Veramo: 5.4.1
did-jwt: 7.2.5
The text was updated successfully, but these errors were encountered:
mirceanis
changed the title
publicKeyMultibase in a DID document is not usable to verify JWT credentials
[bug] publicKeyMultibase in a DID document is not usable to verify JWT credentials
Sep 19, 2023
Bug severity
3
Describe the bug
Credentials issued by did:peer fail verification.
Here is a sample test to reproduce the issue:
Details
It seems that the
publicKeyMultibase
is a multibase encoding of a multicodec encoding of an ed25519 public key.did-jwt@7.2.5
doesn't know how to interpret the multicodec encoding so it tries to use the byte array as is so verification fails.The fix would be in the did-jwt library.
Versions (please complete the following information):
The text was updated successfully, but these errors were encountered: