crypto: add KeyObject.from and keyObject.export JWK format support#36203
Closed
panva wants to merge 3 commits intonodejs:masterfrom
Closed
crypto: add KeyObject.from and keyObject.export JWK format support#36203panva wants to merge 3 commits intonodejs:masterfrom
panva wants to merge 3 commits intonodejs:masterfrom
Conversation
This API exposes key details. It is conceptually different from the previously discussed keyObject.fields property since it does not give access to information that could compromise the security of the key, and the obtained information cannot be used to uniquely identify a key. The intended purpose is to determine "security properties" of keys, e.g. to generate a new key pair with the same parameters, or to decide whether a key is secure enough. closes nodejs#30045
Collaborator
|
Review requested:
|
addaleax
reviewed
Nov 20, 2020
| env->context(), | ||
| env->jwk_kty_string(), | ||
| env->jwk_okp_string()).IsNothing()) { | ||
| return Nothing<bool>(); |
Member
There was a problem hiding this comment.
This leaks rawX – is there any reason not to use a standard container here instead, i.e. std::vector<uint8_t> raw_x(len);? ditto below for rawD (/raw_d)
Member
Author
|
I'm closing this for now. Once #36879 lands i'll open a new proposal. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'm opening this Draft PR to see/probe if there's interest in taking it further (cleaning up and getting it ready to land, which i'm all willing to do). It builds on top of #36188
This adds the
'jwk'format option value forkeyObject.export. It also adds aKeyObject.fromJwkstatic method (its functionality should probably be added toKeyObject.frombut I don't think that one was meant to ship in the first place so maybe this could completely replace it, see the question in code.)WDYT? Is it worth spending further time on in hopes of being accepted?
refs #24471
refs #26854
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes