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:

Members

aeadAlgorithm :enums.aead

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

Type:
  • enums.aead
Source:

sessionKeyAlgorithm :enums.symmetric

Algorithm to encrypt the message with

Type:
  • enums.symmetric
Source:

sessionKeyEncryptionAlgorithm :enums.symmetric

Algorithm to encrypt the session key with

Type:
  • enums.symmetric
Source:

Methods

(async) decrypt(passphrase)

Decrypts the session key with the given passphrase

Parameters:
Name Type Description
passphrase String

The passphrase in string form

Source:
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:
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:

write() → {Uint8Array}

Create a binary representation of a tag 3 packet

Source:
Returns:

The Uint8Array representation.

Type
Uint8Array