# Class: SymmetricallyEncryptedDataPacket

## SymmetricallyEncryptedDataPacket()

Implementation of the Symmetrically Encrypted Data Packet (Tag 9)

RFC4880 5.7: The Symmetrically Encrypted Data packet contains data encrypted with a symmetric-key algorithm. When it has been decrypted, it contains other packets (usually a literal data packet or compressed data packet, but in theory other Symmetrically Encrypted Data packets or sequences of packets that form whole OpenPGP messages).

## Constructor

#### new SymmetricallyEncryptedDataPacket()

Source:
  - packet/symmetrically_encrypted_data.js, line 48

### Members

#### encrypted

Encrypted secret-key data

Source:
  - packet/symmetrically_encrypted_data.js, line 57

#### packets :PacketList

Decrypted packets contained within.

##### Type:

- PacketList

Source:
  - packet/symmetrically_encrypted_data.js, line 62

### Methods

#### (async) decrypt(sessionKeyAlgorithm, key, configopt)

Decrypt the symmetrically-encrypted packet data See RFC 4880 9.2 for algorithms.

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`sessionKeyAlgorithm` | module:enums.symmetric |  | Symmetric key algorithm to use
`key` | Uint8Array |  | The key of cipher blocksize length to be used
`config` | Object | <optional> | Full configuration, defaults to openpgp.config

Source:
  - packet/symmetrically_encrypted_data.js, line 83

##### Throws:

if decryption was not successful

Type
  Error

#### (async) encrypt(sessionKeyAlgorithm, key, configopt)

Encrypt the symmetrically-encrypted packet data See RFC 4880 9.2 for algorithms.

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`sessionKeyAlgorithm` | module:enums.symmetric |  | Symmetric key algorithm to use
`key` | Uint8Array |  | The key of cipher blocksize length to be used
`config` | Object | <optional> | Full configuration, defaults to openpgp.config

Source:
  - packet/symmetrically_encrypted_data.js, line 108

##### Throws:

if encryption was not successful

Type
  Error