crypto: support OpenSSL STORE private keys#63949
Open
panva wants to merge 5 commits into
Open
Conversation
Collaborator
|
Review requested:
|
43f0d74 to
96c5081
Compare
ddd7eaf to
35bb771
Compare
jasnell
previously approved these changes
Jun 19, 2026
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
I changed the feature shape quite a bit. Dismissing a stale review.
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.
Note
Looking for reviews from folk knowledgeable of OpenSSL STORE providers.
Allow
crypto.createPrivateKey()and private-key consumers such ascrypto.sign()to load private keys from WHATWGURLobjects via OpenSSL STORE.This supports both direct URL input:
and object input with optional STORE credentials and OpenSSL property query
metadata:
The
propertiesoption is passed to OpenSSL as the property query used when fetching the STORE loader. It is not appended to the URL and is distinct from provider-specific URI parameters such as PKCS#11 token or object attributes.Permission model
STORE loading is gated by a new
crypto.storepermission capability. When the Permission Model is enabled, attempts to load private keys from STORE URLs require--allow-crypto-store; otherwiseERR_ACCESS_DENIEDis thrown.$ node --permission --allow-crypto-store app.mjsThe permission is exposed through the runtime permission APIs:
For
file:STORE URLs, the existing file-system permission still applies as well: Node checksfs.readfor the resolved file path before calling OpenSSL.Passphrases and errors
The
passphraseoption is forwarded to OpenSSL's STORE UI callback and serves as the passphrase or PIN for encrypted or token-protected private keys.If OpenSSL requests a passphrase and none was provided, Node throws
ERR_MISSING_PASSPHRASE, matching the existing encrypted private-key import behavior. Incorrect passphrases continue to surface as OpenSSL errors.