crypto.createVerify(algorithm[, options])
-
algorithm
<string> -
options
<Object>stream.Writable
选项¥
options
<Object>stream.Writable
options -
返回:<Verify>
¥Returns: <Verify>
创建并返回使用给定算法的 Verify
对象。使用 crypto.getHashes()
获取可用签名算法的名称数组。可选的 options
参数控制 stream.Writable
行为。
¥Creates and returns a Verify
object that uses the given algorithm.
Use crypto.getHashes()
to obtain an array of names of the available
signing algorithms. Optional options
argument controls the
stream.Writable
behavior.
在某些情况下,可以使用签名算法的名称(例如 'RSA-SHA256'
)而不是摘要算法来创建 Verify
实例。这将使用相应的摘要算法。这不适用于所有签名算法,例如 'ecdsa-with-SHA256'
,因此最好始终使用摘要算法名称。
¥In some cases, a Verify
instance can be created using the name of a signature
algorithm, such as 'RSA-SHA256'
, instead of a digest algorithm. This will use
the corresponding digest algorithm. This does not work for all signature
algorithms, such as 'ecdsa-with-SHA256'
, so it is best to always use digest
algorithm names.