AttachmentDecryptionStream

Incremental authenticated decryption for a private staged destination.

Bytes returned by update remain unauthenticated. Delete the staged file unless finish succeeds, then atomically move it into its final location.

Constructors

Link copied to clipboard
constructor(key: ByteArray, nonce: ByteArray)

Functions

Link copied to clipboard
fun cancel()

Zeroize state and reject further updates.

Link copied to clipboard
open override fun close()

Cancel unfinished work and release the native stream.

Link copied to clipboard
fun finish(authenticationTag: ByteArray): AttachmentTransformFinal

Authenticate the complete stream and return final hashes.

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

Decrypt the next ciphertext chunk into unauthenticated staged bytes.