Skip to content

Improve JWK types and methods, add did:jwks support#29

Merged
venables merged 2 commits intomainfrom
venables/jwk-improvements
Aug 12, 2025
Merged

Improve JWK types and methods, add did:jwks support#29
venables merged 2 commits intomainfrom
venables/jwk-improvements

Conversation

@venables
Copy link
Contributor

  • Adds methods to allow more explicit identification of publicKey-only JWKs vs JWKs containing a private key.
  • Adds a did:jwks resolver

Copy link
Collaborator

@domleboss97 domleboss97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💅🏻

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

love it

case "jwk":
verificationMethod.type = "JsonWebKey2020"
verificationMethod.publicKeyJwk = value
verificationMethod.publicKeyJwk = getPublicKeyJwk(value)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there any way to enforce that the function itself never gets called with a jwk containing a private key, and not have to do that here? if not might be good to add a unit test for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great point. Turns out that method signature actually required it to be a PublicKeyJwk anyway, so I was able to drop this.

@venables venables force-pushed the venables/jwk-improvements branch from 91c2d41 to 6c94788 Compare August 12, 2025 17:51
@venables venables merged commit 05d7c03 into main Aug 12, 2025
2 checks passed
@venables venables deleted the venables/jwk-improvements branch August 12, 2025 19:15
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.

2 participants