encrypt

fun encrypt(cipher: Cipher, plaintext: String): EncryptedData(source)

Chiffre plaintext avec un Cipher déjà initialisé (et authentifié si la clé est biométrique).

Obtenir le cipher via createEncryptCipher puis BiometricPrompt.CryptoObject pour les clés protégées.


fun encrypt(config: KeystoreConfig, plaintext: String): EncryptedData(source)

Chiffre plaintext avec la clé identifiée par config.

⚠️ Ne pas utiliser avec KeystoreConfig.requireBiometric = true : utiliser createEncryptCipher + BiometricPrompt.CryptoObject à la place.