# Class: SymEncryptedSessionKeyPacket

## SymEncryptedSessionKeyPacket(configopt)

Symmetric-Key Encrypted Session Key Packets (Tag 3)

RFC4880 5.3: The Symmetric-Key Encrypted Session Key packet holds the symmetric-key encryption of a session key used to encrypt a message. Zero or more Public-Key Encrypted Session Key packets and/or Symmetric-Key Encrypted Session Key packets may precede a Symmetrically Encrypted Data packet that holds an encrypted message. The message is encrypted with a session key, and the session key is itself encrypted and stored in the Encrypted Session Key packet or the Symmetric-Key Encrypted Session Key packet.

## Constructor

#### new SymEncryptedSessionKeyPacket(configopt)

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`config` | Object | <optional> | Full configuration, defaults to openpgp.config

Source:
  - packet/sym_encrypted_session_key.js, line 39

### Members

#### aeadAlgorithm :enums.aead

AEAD mode to encrypt the session key with (if AEAD protection is enabled)

##### Type:

- enums.aead

Source:
  - packet/sym_encrypted_session_key.js, line 64

#### sessionKeyAlgorithm :enums.symmetric

Algorithm to encrypt the message with

##### Type:

- enums.symmetric

Source:
  - packet/sym_encrypted_session_key.js, line 59

#### sessionKeyEncryptionAlgorithm :enums.symmetric

Algorithm to encrypt the session key with

##### Type:

- enums.symmetric

Source:
  - packet/sym_encrypted_session_key.js, line 54

### Methods

#### (async) decrypt(passphrase)

Decrypts the session key with the given passphrase

##### Parameters:

Name | Type | Description
--- | --- | ---
`passphrase` | String | The passphrase in string form

Source:
  - packet/sym_encrypted_session_key.js, line 161

##### Throws:

if decryption was not successful

Type
  Error

#### (async) encrypt(passphrase, configopt)

Encrypts the session key with the given passphrase

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`passphrase` | String |  | The passphrase in string form
`config` | Object | <optional> | Full configuration, defaults to openpgp.config

Source:
  - packet/sym_encrypted_session_key.js, line 192

##### Throws:

if encryption was not successful

Type
  Error

#### read(bytes)

Parsing function for a symmetric encrypted session key packet (tag 3).

##### Parameters:

Name | Type | Description
--- | --- | ---
`bytes` | Uint8Array | Payload of a tag 3 packet

Source:
  - packet/sym_encrypted_session_key.js, line 75

#### write() → {Uint8Array}

Create a binary representation of a tag 3 packet

Source:
  - packet/sym_encrypted_session_key.js, line 130

##### Returns:

The Uint8Array representation.

Type
  Uint8Array