crypto.setEngine(engine[, flags])


稳定性: 0 - 已弃用

加载并设置 engine 用于某些或所有 OpenSSL 函数(由标志选择)。因为自 OpenSSL 3 起自定义引擎支持已被弃用,所以这个 API 也被弃用了。

🌐 Load and set the engine for some or all OpenSSL functions (selected by flags). Use of this API is deprecated because custom engine support has been deprecated since OpenSSL 3.

engine 可以是引擎的 ID 或引擎共享库的路径。

可选的 flags 参数默认使用 ENGINE_METHOD_ALL。flags 是一个位字段,可以采用以下标志之一或其组合(在 crypto.constants 中定义):

🌐 The optional flags argument uses ENGINE_METHOD_ALL by default. The flags is a bit field taking one of or a mix of the following flags (defined in crypto.constants):

  • crypto.constants.ENGINE_METHOD_RSA
  • crypto.constants.ENGINE_METHOD_DSA
  • crypto.constants.ENGINE_METHOD_DH
  • crypto.constants.ENGINE_METHOD_RAND
  • crypto.constants.ENGINE_METHOD_EC
  • crypto.constants.ENGINE_METHOD_CIPHERS
  • crypto.constants.ENGINE_METHOD_DIGESTS
  • crypto.constants.ENGINE_METHOD_PKEY_METHS
  • crypto.constants.ENGINE_METHOD_PKEY_ASN1_METHS
  • crypto.constants.ENGINE_METHOD_ALL
  • crypto.constants.ENGINE_METHOD_NONE