Error: DID document for did:web:localhost:xyz does not have public keys for ES256K
See original GitHub issueBug severity 5
Describe the bug Not being able to parse a self attested JWT message.
To Reproduce Having the following DID document (that can also be resolved from my localhost at: https://localhost/73650cd4-4750-49bc-ae90-fae346e53e58/did.json):
didDocument: {
"@context": "https://w3id.org/did/v1",
"id": "did:web:localhost:35d051b7-b805-442d-ad72-9111d16ed59a",
"publicKey": [
{
"id": "did:web:localhost:35d051b7-b805-442d-ad72-9111d16ed59a#0x8994970c7bff918770328f2dcbed535fc8c2605d",
"type": "Secp256k1VerificationKey2018",
"controller": "did:web:localhost:35d051b7-b805-442d-ad72-9111d16ed59a",
"publicKeyHex": "0x8994970c7bff918770328f2dcbed535fc8c2605d"
}
],
"authentication": [
{
"type": "Secp256k1SignatureAuthentication2018",
"publicKey": "did:web:localhost:35d051b7-b805-442d-ad72-9111d16ed59a#0x8994970c7bff918770328f2dcbed535fc8c2605d"
}
],
"service": []
}
didDocumentMetadata: {}
didResolutionMetadata: {
"contentType": "application/did+ld+json"
}
And trying to parse the following JWT as a message: eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NksifQ.eyJ2YyI6eyJjcmVkZW50aWFsU3ViamVjdCI6eyJ1c2VybmFtZSI6ImxvY2FsaG9zdDo5MzAwMTU0ZS02NWM4LTRkMjEtOWQ2Mi0yNjNiZTgyMDY1ZmIifSwiQGNvbnRleHQiOlsiaHR0cHM6Ly93d3cudzMub3JnLzIwMTgvY3JlZGVudGlhbHMvdjEiXSwidHlwZSI6WyJWZXJpZmlhYmxlQ3JlZGVudGlhbCJdfSwibmJmIjoxNjE5ODMxOTkwLCJpc3MiOiJkaWQ6d2ViOmxvY2FsaG9zdDozNWQwNTFiNy1iODA1LTQ0MmQtYWQ3Mi05MTExZDE2ZWQ1OWEifQ.mIWecXLhjJnmMbDfy9Cj5Sw9XRzuYNHcMWtCs0t82aoKIwbovh0yrhtpw8fjXH4fXiEFquNGTbrKYO31wdbuJQ
Observed behaviour The following internal error is thrown:
Exception has occurred: Error: DID document for did:web:localhost:35d051b7-b805-442d-ad72-9111d16ed59a does not have public keys for ES256K
at /repo/node_modules/did-jwt/src/JWT.ts:353:5
at processTicksAndRejections (internal/process/task_queues.js:93:5)
However, because of the way Veramo is handling messages, the exception that is caught in my code is:
Exception has occurred: Error: Unsupported message type
(It was little bit tough to catch the internal exception. I hope Veramo will next be more elaborative for such exceptions)
Expected behaviour Be able to read the self-attested claim that is inside the JWT with no issues.
Additional context We are implementing a plugin to use Web DID method.
Versions (please complete the following information):
- Veramo: 1.1.0
- Node Version: 12.13.0
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
Yes, thanks @mirceanis the issue described here has been resolved.
Thank you so much @mirceanis , you helped us too many times.
We will keep using Veramo and we will keep posting feedback that could help Veramo Team to make this awesome framework better.