cipher.getAuthTag()


当使用经验证的加密模式时(目前只有GCM支持),cipher.getAuthTag()方法返回一个Buffer,此Buffer包含已从给定数据计算后的authentication tagcipher.getAuthTag()方法只能在使用cipher.final()方法完全加密后调用。

  • Returns: <Buffer> When using an authenticated encryption mode (GCM, CCM and OCB are currently supported), the cipher.getAuthTag() method returns a Buffer containing the authentication tag that has been computed from the given data.

The cipher.getAuthTag() method should only be called after encryption has been completed using the cipher.final() method.