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.
Functions
Generates an asymmetric key pair in the Android keystore. This method configures the key generation parameters, including key size, block modes, encryption paddings, and user authentication requirements. It also handles the case where StrongBox is unavailable and falls back to generating the key without StrongBox support.
Generates a secret key in the Android keystore. This method configures the key generation parameters, including key size, block modes, encryption paddings, and user authentication requirements. It also handles the case where StrongBox is unavailable and falls back to generating the key without StrongBox support.
Generates an embedded secret key. If a private key is provided, it uses it to encrypt the secret key. Otherwise, it generates a new asymmetric key pair in the Android keystore.
Retrieves the embedded secret key from the encrypted data using the provided private key.
Retrieves the secret key for encryption