crypto.createSign(algorithm[, options])
algorithm
<string>options
<Object>stream.Writable
选项- 返回: <Sign>
创建并返回使用给定的 algorithm
的 Sign
对象。
使用 crypto.getHashes()
获取可用摘要算法的名称。
可选的 options
参数控制 stream.Writable
行为。
在某些情况下,可以使用签名算法的名称(例如 'RSA-SHA256'
)而不是摘要算法来创建 Sign
实例。
这将使用相应的摘要算法。
这不适用于所有签名算法,例如 'ecdsa-with-SHA256'
,因此最好始终使用摘要算法名称。
algorithm
<string>options
<Object>stream.Writable
options- Returns: <Sign>
Creates and returns a Sign
object that uses the given algorithm
. Use
crypto.getHashes()
to obtain the names of the available digest algorithms.
Optional options
argument controls the stream.Writable
behavior.
In some cases, a Sign
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.