AndroidMEncryptor

Provide data encryption and decryption for Android M device.

Inheritors

Constructors

Link copied to clipboard
constructor(@NonNull keyAlias: String)

Properties

Link copied to clipboard
private val AES_GCM_NO_PADDING: String = "AES/GCM/NOPADDING"
Link copied to clipboard
val ANDROID_KEYSTORE: String = "AndroidKeyStore"
Link copied to clipboard
private val HMAC_SHA256: String = "HmacSHA256"
Link copied to clipboard
val IV_LENGTH: Int = 12
Link copied to clipboard
val KEY_SIZE: Int = 256
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open fun decrypt(encryptedData: Array<Byte>): Array<Byte>
Decrypts the data.
Link copied to clipboard
open fun encrypt(@NonNull data: Array<Byte>): Array<Byte>
abstract fun encrypt(clearText: Array<Byte>): Array<Byte>
Encrypts the data.
Link copied to clipboard
open fun getEncryptor(context: Context, keyAlias: String): Encryptor
Link copied to clipboard
private open fun getKeyStore(): KeyStore
Retrieve and load the Android KeyStore
Link copied to clipboard
protected open fun getSecretKey(): SecretKey
Retrieve the SecretKey.
Link copied to clipboard
open fun init(cipher: Cipher): Array<Byte>
Link copied to clipboard
open fun reset()
Reset the Encryption Provider, remove all created keys