对于Node.js的crypto.createSign有效算法的输入字符串()
我使用节点的加密签名的一个项目,并一直在努力考虑各种算法的跌宕起伏。 crypto.createSign()
的说明全文如下:
创建并返回一个使用给定算法符号对象。在最近的OpenSSL发布,
openssl list-public-key-algorithms
将显示可用的签名算法。一个例子是 'RSA-SHA256'。
不幸的是,“RSA-SHA256”不是(如下所示)openssl list-public-key-algorithms
的输出值中的一个。
那么,什么是这个功能的有效值,或者他们如何从下面的列表中提取?
OpenSSL list result:
Name: OpenSSL RSA method
Type: Builtin Algorithm
OID: rsaEncryption
PEM string: RSA
Name: rsa
Type: Alias to rsaEncryption
Name: OpenSSL PKCS#3 DH method
Type: Builtin Algorithm
OID: dhKeyAgreement
PEM string: DH
Name: dsaWithSHA
Type: Alias to dsaEncryption
Name: dsaEncryption-old
Type: Alias to dsaEncryption
Name: dsaWithSHA1-old
Type: Alias to dsaEncryption
Name: dsaWithSHA1
Type: Alias to dsaEncryption
Name: OpenSSL DSA method
Type: Builtin Algorithm
OID: dsaEncryption
PEM string: DSA
Name: OpenSSL EC algorithm
Type: Builtin Algorithm
OID: id-ecPublicKey
PEM string: EC
Name: OpenSSL HMAC method
Type: Builtin Algorithm
OID: hmac
PEM string: HMAC
Name: OpenSSL CMAC method
Type: Builtin Algorithm
OID: cmac
PEM string: CMAC
回答如下:
我觉得节点文件是错误的。对于crypto.createSign()
,请使用以下命令列出的可能性:
openssl list-message-digest-algorithms
对于Node.js的crypto.createSign有效算法的输入字符串()
我使用节点的加密签名的一个项目,并一直在努力考虑各种算法的跌宕起伏。 crypto.createSign()
的说明全文如下:
创建并返回一个使用给定算法符号对象。在最近的OpenSSL发布,
openssl list-public-key-algorithms
将显示可用的签名算法。一个例子是 'RSA-SHA256'。
不幸的是,“RSA-SHA256”不是(如下所示)openssl list-public-key-algorithms
的输出值中的一个。
那么,什么是这个功能的有效值,或者他们如何从下面的列表中提取?
OpenSSL list result:
Name: OpenSSL RSA method
Type: Builtin Algorithm
OID: rsaEncryption
PEM string: RSA
Name: rsa
Type: Alias to rsaEncryption
Name: OpenSSL PKCS#3 DH method
Type: Builtin Algorithm
OID: dhKeyAgreement
PEM string: DH
Name: dsaWithSHA
Type: Alias to dsaEncryption
Name: dsaEncryption-old
Type: Alias to dsaEncryption
Name: dsaWithSHA1-old
Type: Alias to dsaEncryption
Name: dsaWithSHA1
Type: Alias to dsaEncryption
Name: OpenSSL DSA method
Type: Builtin Algorithm
OID: dsaEncryption
PEM string: DSA
Name: OpenSSL EC algorithm
Type: Builtin Algorithm
OID: id-ecPublicKey
PEM string: EC
Name: OpenSSL HMAC method
Type: Builtin Algorithm
OID: hmac
PEM string: HMAC
Name: OpenSSL CMAC method
Type: Builtin Algorithm
OID: cmac
PEM string: CMAC
回答如下:
我觉得节点文件是错误的。对于crypto.createSign()
,请使用以下命令列出的可能性:
openssl list-message-digest-algorithms