AttachmentEncryptionStream

Incremental encryption compatible with released clients.

Write nonce, each update result, and the final authentication tag to a private staged file. Publish that file only after finish succeeds.

Constructors

Link copied to clipboard
constructor(key: ByteArray)

Properties

Link copied to clipboard

Fresh 12-byte nonce that must prefix the encrypted output.

Functions

Link copied to clipboard
fun cancel()

Zeroize state and reject further updates without publishing output.

Link copied to clipboard
open override fun close()

Cancel unfinished work and release the native stream.

Link copied to clipboard

Finalize authentication and return hashes plus the tag to append.

Link copied to clipboard
fun update(plaintext: ByteArray): ByteArray

Encrypt the next plaintext chunk and return its ciphertext bytes.