cipher.setAAD(buffer[, options])
buffer<Buffer> | <TypedArray> | <DataView>options<Object>stream.transform选项plaintextLength<number>
- 返回: <Cipher> 用于方法链。
当使用认证的加密模式时(当前支持 GCM、CCM 和 OCB),则 cipher.setAAD() 方法设置用于额外的认证数据 (AAD) 输入参数的值。
options 选项对于 GCM 和 OCB 是可选的。
使用 CCM 时,必须指定 plaintextLength 选项,其值必须与明文的字节长度匹配。
请参见 CCM 模式。
cipher.setAAD() 方法必须在 cipher.update() 之前调用。
buffer<Buffer> | <TypedArray> | <DataView>options<Object>stream.transformoptionsplaintextLength<number>
- Returns: <Cipher> for method chaining.
When using an authenticated encryption mode (GCM, CCM and OCB are
currently supported), the cipher.setAAD() method sets the value used for the
additional authenticated data (AAD) input parameter.
The options argument is optional for GCM and OCB. When using CCM, the
plaintextLength option must be specified and its value must match the length
of the plaintext in bytes. See CCM mode.
The cipher.setAAD() method must be called before cipher.update().