Methods
(async) crypt(fn, key, data, streaming) → {Uint8Array|ReadableStream.<Uint8Array>}
En/decrypt the payload.
Parameters:
Name | Type | Description |
---|---|---|
fn |
encrypt | decrypt | Whether to encrypt or decrypt |
key |
Uint8Array | The session key used to en/decrypt the payload |
data |
Uint8Array | ReadableStream.<Uint8Array> | The data to en/decrypt |
streaming |
Boolean | Whether the top-level function will return a stream |
- Source:
Returns:
- Type
- Uint8Array | ReadableStream.<Uint8Array>
(async) decrypt(sessionKeyAlgorithm, key, streaming)
Decrypt the encrypted payload.
Parameters:
Name | Type | Description |
---|---|---|
sessionKeyAlgorithm |
String | The session key's cipher algorithm e.g. 'aes128' |
key |
Uint8Array | The session key used to encrypt the payload |
streaming |
Boolean | Whether the top-level function will return a stream |
- Source:
Throws:
-
if decryption was not successful
- Type
- Error
(async) encrypt(sessionKeyAlgorithm, key, streaming, config)
Encrypt the packet list payload.
Parameters:
Name | Type | Description |
---|---|---|
sessionKeyAlgorithm |
String | The session key's cipher algorithm e.g. 'aes128' |
key |
Uint8Array | The session key used to encrypt the payload |
streaming |
Boolean | Whether the top-level function will return a stream |
config |
Object | (optional) full configuration, defaults to openpgp.config |
- Source:
Throws:
-
if encryption was not successful
- Type
- Error
(async) read(bytes)
Parse an encrypted payload of bytes in the order: version, IV, ciphertext (see specification)
Parameters:
Name | Type | Description |
---|---|---|
bytes |
Uint8Array | ReadableStream.<Uint8Array> |
- Source:
write() → {Uint8Array|ReadableStream.<Uint8Array>}
Write the encrypted payload of bytes in the order: version, IV, ciphertext (see specification)
- Source:
Returns:
The encrypted payload
- Type
- Uint8Array | ReadableStream.<Uint8Array>