-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
adds support for W3C ES256K #462
Conversation
I recommend changing "EcdsaSecp256k1VerificationKey2019" to ES256K. In the context of JWT, only ES256K is needed to signal the alg and key type. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great!
One question I have is where you got the value for the EC curve (1.3.132.0.10
). I searched for it online, and only found it referenced in a few websites like oid-info.com and oidref.com. It would be nice to see this value referenced from somewhere like IETF or other standards organization.
@bshaffer I used oid-info.com but its also in the source code for phpseclib here https://github.com/phpseclib/phpseclib/blob/master/phpseclib/Crypt/EC/Formats/Keys/Common.php#L120 |
@bshaffer Would like to get your opinion on swapping the order of the merge in from if (isset($head) && \is_array($head)) {
$header = \array_merge($head, $header);
} to if (isset($head) && \is_array($head)) {
$header = array_filter(\array_merge($header, $head));
} |
My initial thought is that this could change existing behavior, so unless it's a bug, I don't think we should allow it. Also, it's unrelated (AFAIK) to this PR, and so should be in a separate PR as a feat or fix. What is the rational for blanking out |
Agreed it should be a separate PR so i'll raise that later when required In the DIF .well-known DID configuration file the JWT used for proof requires Maybe @OR13 knows why this is a requirement ? |
That requirement regarding typ is getting removed, I'd ignore it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking pretty good! Just one more suggestion and this is good to go.
EDIT: Also, it looks like you still need to sign the Google CLA
Updates in_array to enable strict mode Co-authored-by: Brent Shaffer <betterbrent@google.com>
@bshaffer thanks for the comment, ive updated that strict flag as per your suggestion. |
Adds support for decoding JWTs using EcdsaSecp256k1Signature2019 which will become very popular due to Decentralised Identifiers becoming a W3C recommendation.
These signatures are used in Verifiable Credential issuance and presentations, see here https://identity.foundation/jwt-vc-presentation-profile.
Microsoft is using this method to sign their JWTs, see here https://learn.microsoft.com/en-us/azure/active-directory/verifiable-credentials/verifiable-credentials-standards#supported-algorithms
Please let me know if I've missed anything.