cipher.getAuthTag()
- 返回值: <Buffer> 当使用经过认证的加密模式(当前支持
GCM、CCM、OCB和chacha20-poly1305)时,cipher.getAuthTag()方法会返回一个Buffer,其中包含根据给定数据计算出的 认证标签。
cipher.getAuthTag() 方法应该只在使用 cipher.final() 方法完成加密后调用。
【The cipher.getAuthTag() method should only be called after encryption has
been completed using the cipher.final() method.】
如果在创建 cipher 实例时设置了 authTagLength 选项,该函数将返回正好 authTagLength 字节的数据。
【If the authTagLength option was set during the cipher instance's creation,
this function will return exactly authTagLength bytes.】