question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: DID document for did:web:localhost:xyz does not have public keys for ES256K

See original GitHub issue

Bug 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:closed
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
Muhammad-Altabbacommented, May 18, 2021

Yes, thanks @mirceanis the issue described here has been resolved.

1reaction
koptancommented, May 2, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The did:key Method v0.7
This specification describes a non-registry based DID Method based on expanding a cryptographic public key into a DID Document.
Read more >
Public Key Cryptography - IBM
Public -key cryptography solves the logistical problem of key distribution by using both a public key and a private key. The public key...
Read more >
Issuing And Verifying Ethereum DIDs with Metamask - Medium
Due to how the key pair was generated, the owner can prove ownership of the public key without ever having to disclose the...
Read more >
Downloading public keys - AWS Key Management Service
Any user who can get the public key can use it outside of AWS KMS even if they don't have permission to encrypt...
Read more >
JSON Web Key Sets - Auth0
The JSON Web Key Set (JWKS) is a set of keys containing the public keys used ... This endpoint will contain the JWK...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found