Constructor
new PublicKeyEncryptedSessionKeyPacket()
Members
encrypted :Object
Type:
- Object
sessionKeyAlgorithm :enums.symmetric
Algorithm to encrypt the message with
Type:
- enums.symmetric
Methods
(async) decrypt(key, randomSessionKeyopt)
Decrypts the session key (only for public key encrypted session key packets (tag 1)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
key |
SecretKeyPacket | decrypted private key |
|
randomSessionKey |
Object |
<optional> |
Bogus session key to use in case of sensitive decryption error, or if the decrypted session key is of a different type/size. This is needed for constant-time processing. Expected object of the form: { sessionKey: Uint8Array, sessionKeyAlgorithm: enums.symmetric } |
Throws:
-
if decryption failed, unless
randomSessionKey
is given - Type
- Error
(async) encrypt(key)
Encrypt session key packet
Parameters:
Name | Type | Description |
---|---|---|
key |
PublicKeyPacket | Public key |
Throws:
-
if encryption failed
- Type
- Error
read(bytes)
Parsing function for a publickey encrypted session key packet (tag 1).
Parameters:
Name | Type | Description |
---|---|---|
bytes |
Uint8Array | Payload of a tag 1 packet |
write() → {Uint8Array}
Create a binary representation of a tag 1 packet
Returns:
The Uint8Array representation.
- Type
- Uint8Array