Encryptor

Encrypts plaintext data to ciphertext.

Provides suspend, blocking, and streaming variants.

For the decryption counterpart, see Decryptor.

Inheritors

Functions

Link copied to clipboard
open suspend fun encrypt(plaintext: ByteArray): ByteArray

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

open suspend fun encrypt(plaintext: ByteString): ByteString

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

Link copied to clipboard
abstract fun encryptBlocking(plaintext: ByteArray): ByteArray

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

open fun encryptBlocking(plaintext: ByteString): ByteString

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

Link copied to clipboard
abstract fun encryptingSink(ciphertext: RawSink): RawSink

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

Link copied to clipboard
abstract fun encryptingSource(plaintext: RawSource): RawSource

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