Class: SymEncryptedIntegrityProtected

packet.SymEncryptedIntegrityProtected()

new SymEncryptedIntegrityProtected()

Implementation of the Sym. Encrypted Integrity Protected Data Packet (Tag 18)

RFC4880 5.13: The Symmetrically Encrypted Integrity Protected Data packet is a variant of the Symmetrically Encrypted Data packet. It is a new feature created for OpenPGP that addresses the problem of detecting a modification to encrypted data. It is used in combination with a Modification Detection Code packet.

Source:

Members

encrypted

The encrypted payload.

Source:

modification :Boolean

If after decrypting the packet this is set to true, a modification has been detected and thus the contents should be discarded.

Type:
  • Boolean
Source:

Methods

(async) decrypt(sessionKeyAlgorithm, key, streaming) → {Promise.<Boolean>}

Decrypts the encrypted data contained in the packet.

Parameters:
Name Type Description
sessionKeyAlgorithm String

The selected symmetric encryption algorithm to be used e.g. 'aes128'

key Uint8Array

The key of cipher blocksize length to be used

streaming Boolean

Whether to read this.encrypted as a stream

Source:
Returns:
Type
Promise.<Boolean>

(async) encrypt(sessionKeyAlgorithm, key, streaming) → {Promise.<Boolean>}

Encrypt the payload in the packet.

Parameters:
Name Type Description
sessionKeyAlgorithm String

The selected symmetric encryption algorithm to be used e.g. 'aes128'

key Uint8Array

The key of cipher blocksize length to be used

streaming Boolean

Whether to set this.encrypted to a stream

Source:
Returns:
Type
Promise.<Boolean>