-
Notifications
You must be signed in to change notification settings - Fork 71
Fixed typo in a few statements of the EC key import operation #412
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
Conversation
…s of the "use" JWK field.
|
"sig" and "enc" are the registered JWK "use" values - https://www.iana.org/assignments/jose/jose.xhtml#web-key-use |
Indeed, I have just realized. However, we are checking for "sign" in all the importKey test. I assume "sign" is also valid for any of the specified algorithms, but perhaps we should clarify it in the spec somehow. Do you think it's worth discussing it in a spec issue ? Otherwise, if it's clear already I'm happy to abandon this PR. |
Don't we? |
Yeah, I confused the WebCrypto "usages" with the JWK fileds. I don't think the spec needs any change here. However, we don't have tests in the wpt repo to verify the implementations accept "sig" in the JWK "use" filed. There are just tests to verify clearly invalid values raise a DataError exception. Perhaps we should add some to verify the "sig" is accepted. |
|
I think the confusion is because of me. So, our implementation misses the checks for jwk.use field. WebCryptoAPI: Thus, I interpret it as the private key may have a use field with 'sig' there? RFC 7517: |
yes |
|
So, just to be clear: We extend the RFC 7517 by re-using the field "use" for private keys. If a private key has a jwk field 'use', it should be treated the same way as in the appropriate public key import. It does not go to any documentation, but it's a rule for me to use while implementing |
|
I see what you're getting at now. The use of the "use" jwk parameter is not exclusive to public key representations. |
|
Yea, I was trying to follow the RFC interpretation, where 'use' is just not defined for private keys. |
|
If we squint real hard the JWK private key also always includes the public key ;) |
|
The result of today: Reading RFC is dangerous. |
We lack tests to verify valid values of the "use" filed. Perhaps we should add a few. |
Replace "sig" with "sign" in a few statements about the allowed values of the "use" JWK field.
Preview | Diff