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.

Guide and performance

Types

Link copied to clipboard
object Companion

Start a stream with Rust-generated key material and nonce.

Properties

Link copied to clipboard

Released base64 enc value for authenticated attachment metadata.

Link copied to clipboard

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

Functions

Link copied to clipboard
fun cancel(): ERROR CLASS: Unresolved name: 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.