decipher.setAAD(buffer[, options])
-
buffer
<string> | <ArrayBuffer> | <Buffer> | <TypedArray> | <DataView> -
options
<Object>stream.transform
选项¥
options
<Object>stream.transform
options -
返回:<Decipher> 方法链接的相同解密。
¥Returns: <Decipher> The same Decipher for method chaining.
当使用经过身份验证的加密模式(当前支持 GCM
、CCM
、OCB
和 chacha20-poly1305
)时,decipher.setAAD()
方法设置用于附加身份验证数据 (AAD) 输入参数的值。
¥When using an authenticated encryption mode (GCM
, CCM
, OCB
, and
chacha20-poly1305
are
currently supported), the decipher.setAAD()
method sets the value used for the
additional authenticated data (AAD) input parameter.
options
参数对于 GCM
是可选的。使用 CCM
时,必须指定 plaintextLength
选项,其值必须与密文的字节长度匹配。参见 CCM 模式。
¥The options
argument is optional for GCM
. When using CCM
, the
plaintextLength
option must be specified and its value must match the length
of the ciphertext in bytes. See CCM mode.
decipher.setAAD()
方法必须在 decipher.update()
之前调用。
¥The decipher.setAAD()
method must be called before decipher.update()
.
将字符串作为 buffer
传递时,请考虑 使用字符串作为加密 API 的输入时的注意事项。
¥When passing a string as the buffer
, please consider
caveats when using strings as inputs to cryptographic APIs.