AuthenticatedDecryptor

Decrypts ciphertext with optional associated data for authenticated encryption (AEAD). When associated data is provided, it is verified during decryption. When associated data is null, only the ciphertext authenticity is verified.

For the encryption counterpart, see AuthenticatedEncryptor.

Inheritors

Functions

Link copied to clipboard
open suspend override fun decrypt(ciphertext: ByteArray): ByteArray

Decrypts the given ciphertext without associated data and returns the resulting plaintext as a ByteArray.

open suspend override fun decrypt(ciphertext: ByteString): ByteString

Decrypts the given ciphertext without associated data and returns the resulting plaintext as a ByteString.

open suspend fun decrypt(ciphertext: ByteArray, associatedData: ByteArray?): ByteArray

Decrypts the given ciphertext with optional associatedData and returns the resulting plaintext as a ByteArray.

open suspend fun decrypt(ciphertext: ByteString, associatedData: ByteString?): ByteString

Decrypts the given ciphertext with optional associatedData and returns the resulting plaintext as a ByteString.

Link copied to clipboard
open override fun decryptBlocking(ciphertext: ByteArray): ByteArray

Decrypts the given ciphertext without associated data and returns the resulting plaintext as a ByteArray.

open override fun decryptBlocking(ciphertext: ByteString): ByteString

Decrypts the given ciphertext without associated data and returns the resulting plaintext as a ByteString.

abstract fun decryptBlocking(ciphertext: ByteArray, associatedData: ByteArray?): ByteArray

Decrypts the given ciphertext with optional associatedData and returns the resulting plaintext as a ByteArray.

open fun decryptBlocking(ciphertext: ByteString, associatedData: ByteString?): ByteString

Decrypts the given ciphertext with optional associatedData and returns the resulting plaintext as a ByteString.

Link copied to clipboard
open override fun decryptingSink(plaintext: RawSink): RawSink

Returns a RawSink that decrypts data as it is written, sending the resulting plaintext to plaintext, without associated data.

abstract fun decryptingSink(plaintext: RawSink, associatedData: ByteArray?): RawSink
open fun decryptingSink(plaintext: RawSink, associatedData: ByteString?): RawSink

Returns a RawSink that decrypts data as it is written, sending the resulting plaintext to plaintext, with optional associatedData.

Link copied to clipboard
open override fun decryptingSource(ciphertext: RawSource): RawSource

Returns a RawSource that decrypts data as it is read from the given ciphertext source without associated data.

abstract fun decryptingSource(ciphertext: RawSource, associatedData: ByteArray?): RawSource
open fun decryptingSource(ciphertext: RawSource, associatedData: ByteString?): RawSource

Returns a RawSource that decrypts data as it is read from the given ciphertext source with optional associatedData.