我正在使用節點的加密簽名爲一個項目,並一直試圖考慮各種算法的起伏。 crypto.createSign()
的描述如下所示:Node.js的有效算法輸入字符串crypto.createSign()
創建並返回使用給定算法的Sign對象。在最近的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