SecretKeyEncryptor

An encryptor that uses Android's SecretKey to encrypt and decrypt data. It uses AES/GCM/NoPadding as the cipher and HmacSHA256 for the MAC.

Constructors

Link copied to clipboard
constructor(block: SecretKeyEncryptorConfig.() -> Unit = {})
constructor(config: SecretKeyEncryptorConfig)

Properties

Link copied to clipboard

Functions

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

Decrypts the given data. It uses a lock to ensure thread safety.

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

Encrypts the given data. It uses a lock to ensure thread safety.