IvAuthenticatedDecryptor

Decrypts ciphertext with an explicit initialization vector (IV) and optional associated data. All WithIv methods are marked DelicateCryptographyApi because they require manual IV management rather than relying on the library to generate IVs safely. 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 IvAuthenticatedEncryptor.

Inheritors

Functions

Link copied to clipboard
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.

open suspend fun decrypt(ciphertext: ByteArray): ByteArray

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

open suspend fun decrypt(ciphertext: ByteString): ByteString

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

Link copied to clipboard
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.

open fun decryptBlocking(ciphertext: ByteArray): ByteArray

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

open fun decryptBlocking(ciphertext: ByteString): ByteString

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

Link copied to clipboard
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.

open fun decryptingSink(plaintext: RawSink): RawSink

Returns a RawSink that decrypts data as it is written, sending the resulting plaintext to plaintext. Write ciphertext to the returned sink, and plaintext will be forwarded to plaintext.

Link copied to clipboard

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

abstract fun decryptingSinkWithIv(iv: ByteArray, plaintext: RawSink, associatedData: ByteArray?): RawSink

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

Returns a RawSink that decrypts data as it is written, sending the resulting plaintext to plaintext, using the specified iv.

Link copied to clipboard
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.

open fun decryptingSource(ciphertext: RawSource): RawSource

Returns a RawSource that decrypts data as it is read from the given ciphertext source. The resulting source produces plaintext on reads.

Link copied to clipboard

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

abstract fun decryptingSourceWithIv(iv: ByteArray, ciphertext: RawSource, associatedData: ByteArray?): RawSource

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

Returns a RawSource that decrypts data as it is read from the given ciphertext source using the specified iv.

Link copied to clipboard
open suspend override fun decryptWithIv(iv: ByteArray, ciphertext: ByteArray): ByteArray

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

open suspend override fun decryptWithIv(iv: ByteString, ciphertext: ByteString): ByteString

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

open suspend fun decryptWithIv(iv: ByteArray, ciphertext: ByteArray, associatedData: ByteArray?): ByteArray

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

open suspend fun decryptWithIv(iv: ByteString, ciphertext: ByteString, associatedData: ByteString?): ByteString

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

Link copied to clipboard

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

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

abstract fun decryptWithIvBlocking(iv: ByteArray, ciphertext: ByteArray, associatedData: ByteArray?): ByteArray

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

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