encrypt

open suspend override fun encrypt(plaintext: ByteArray): ByteArray(source)

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

Use encryptBlocking when calling from non-suspending code.


open suspend override fun encrypt(plaintext: ByteString): ByteString(source)

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

Use encryptBlocking when calling from non-suspending code.


open suspend fun encrypt(plaintext: ByteArray, associatedData: ByteArray?): ByteArray(source)

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

Use encryptBlocking when calling from non-suspending code.


open suspend fun encrypt(plaintext: ByteString, associatedData: ByteString?): ByteString(source)

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

Use encryptBlocking when calling from non-suspending code.