Skip to content

Add ECDSA support and fixed DID resolution for hosted public keys #23

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rubenroblesl
Copy link

Introduced support for ECDSA (ES256) signature verification and improved DID resolution process for better compatibility with web-hosted DID documents.

Changes include:

ExternalProofProbe.java

  • Added support for ECDSA (ES256) in addition to RSA (RS256) when validating JWT signatures.
  • Replaced usage of the default ConfigurableDocumentLoader.DOCUMENT_LOADER with new CachingDocumentLoader() to ensure enableHttp, enableHttps, and enableFile flags are correctly enabled by default.

SimpleDidResolver.java

  • Fixed the .well-known DID resolution path by correcting the variable assignment (from /well-known to ./well-known) as specified in the VC Data Model spec.
  • Replaced uri.getPath() == null with a check for an empty string (.isEmpty()), since getPath() never returns null.
  • Modified the logic when extracting the public key from a DID document:
    • Previously, publicKeyMultibase was required and would throw if missing.
    • Now, both publicKeyJwk and publicKeyMultibase are handled conditionally:
      • If publicKeyJwk is present, it is parsed and used.
      • If publicKeyMultibase is present, it is used instead.
    • This provides compatibility with DID documents using either key representation format, as permitted by the spec.

Introduced support for ECDSA (ES256) signature verification and improves the DID resolution process for better compatibility with web-hosted DID documents.

Changes include:

ExternalProofProbe.java
  - Added support for ECDSA (ES256) in addition to RSA (RS256) when validating JWT signatures.
  - Replaced usage of the default `ConfigurableDocumentLoader.DOCUMENT_LOADER` with `new CachingDocumentLoader()` to ensure `enableHttp`, `enableHttps`, and `enableFile` flags are correctly enabled by default.

SimpleDidResolver.java
  - Fixed the `.well-known` DID resolution path by correcting the variable assignment (from `/well-known` to `./well-known`) as specified in the VC Data Model spec.
  - Replaced `uri.getPath() == null` with a check for an empty string (`.isEmpty()`), since `getPath()` never returns `null`.
  - Modified the logic when extracting the public key from a DID document:
    - Previously, `publicKeyMultibase` was required and would throw if missing.
    - Now, both `publicKeyJwk` and `publicKeyMultibase` are handled conditionally:
      - If `publicKeyJwk` is present, it is parsed and used.
      - If `publicKeyMultibase` is present, it is used instead.
    - This provides compatibility with DID documents using either key representation format, as permitted by the spec.
@rubenroblesl
Copy link
Author

@xaviaracil Hi, I'd appreciate If you could review my pull request to the project. Greetings.

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.

1 participant