来自 OpenSSL STORE 加载器的私钥
🌐 Private keys from OpenSSL STORE loaders
如果 key 是一个 <URL>(或者是一个 key 为 <URL> 的对象),私钥会通过 OpenSSL STORE 加载器加载。URL 会以 URI 的形式传递给 OpenSSL,例如 file: URI 或者像 pkcs11: 这样的供应商支持的方案。当 权限模型 被启用时,需要 --allow-openssl-store。
🌐 If key is a <URL> (or an object whose key is a <URL>), the private key is
loaded through an OpenSSL STORE loader. The URL is passed to OpenSSL as a URI,
for example a file: URI or a provider-backed scheme such as pkcs11:. When
the Permission Model is enabled, --allow-openssl-store is required.
警告:URI 方案不会固定 OpenSSL STORE 加载器,也不能证明返回的密钥来自哪里。Node.js 会将 URI 转发给 OpenSSL,由 OpenSSL 根据其版本和配置选择加载器。例如,OpenSSL 可能会向其
file加载器提供一个不透明的 URI,比如pkcs11:object=...(即方案后没有//的那个),然后才尝试pkcs11加载器。如果完整的 URI 是一个有效的本地路径并且文件存在,也可能会加载该文件。Node.js 不会验证是哪一个加载器提供了密钥。不要依赖特定提供商的 URI 方案来证明密钥来自该提供商或硬件设备。
已配置的 OpenSSL STORE 加载器具有广泛权限,可能会访问文件、设备、令牌或网络。加载器执行的访问不受 fs.read、fs.write 或 net 权限范围的限制。
🌐 Configured OpenSSL STORE loaders have broad authority and may access files,
devices, tokens, or the network. Access performed by a loader is not constrained
by the fs.read, fs.write, or net permission scopes.
当使用 <URL> 时,即使这些选项彼此相关,例如 type 和 format: 'der' 或 namedCurve 和 asymmetricKeyType: 'ec',format、type、asymmetricKeyType 和 namedCurve 也会被忽略。输入会作为 URI 传递给 STORE 加载器,而不会被处理为 PEM、DER、JWK 或原始密钥材料。passphrase 仍然用作传递给加载器的可选 PIN/密码,而如果 passphrase 是字符串,则 encoding 会生效。
🌐 When a <URL> is used, format, type, asymmetricKeyType, and namedCurve
are ignored even when those options would otherwise depend on each other, such
as type with format: 'der' or namedCurve with
asymmetricKeyType: 'ec'. The input is passed to the STORE loader as a URI,
not handled as PEM, DER, JWK, or raw key material. passphrase is still used as
the optional PIN/passphrase passed to the loader, and encoding applies if that
passphrase is a string.
在传给 STORE 加载器的 URI 中不要嵌入凭据,而是使用 passphrase。Node.js 会在自己的权限拒绝资源和诊断信息中屏蔽 URI。加载开始后,OpenSSL 或提供者报告的错误可能仍会包含该 URI。
🌐 Use passphrase instead of embedding credentials in the URI passed to the
STORE loader. Node.js redacts the URI from its own permission-denial resource
and diagnostics. Errors reported by OpenSSL or a provider after loading begins
may include the URI.
当 properties 与 <URL> 键一起指定时,它会作为属性查询传递给 OpenSSL 用于选择 STORE 加载器。它不会被添加到 URL 中,并且与特定提供者的 URI 参数不同。
🌐 When properties is specified with a <URL> key, it is passed to OpenSSL as the
property query for selecting the STORE loader. It is not appended to the URL and
is distinct from provider-specific URI parameters.