TokenEncryptionHandler
interface TokenEncryptionHandler
Interface for defining how Tokens are encrypted before storing in RoomTokenStorage, the default implementation of TokenStorage.
The default implementation is provided, and handles all Credential.Security options. A custom implementation may be useful for more advanced use-cases, and for more fine-grained control in handling biometrics. Custom implementations of TokenEncryptionHandler can be passed to AuthFoundationDefaults.tokenEncryptionHandler.
Inheritors
Types
Functions
Link copied to clipboard
abstract suspend fun decrypt(encryptedToken: ByteArray, encryptionExtras: Map<String, String>, security: Credential.Security, promptInfo: BiometricPrompt.PromptInfo? = Credential.Security.promptInfo): Token
Decrypt the provided encryptedToken, and return the Token.
Link copied to clipboard
abstract suspend fun encrypt(token: Token, security: Credential.Security): TokenEncryptionHandler.EncryptionResult
Encrypt the provided token with security, and return the EncryptionResult.
Link copied to clipboard
Generate the key with the specified Credential.Security. If a key with Credential.Security.keyAlias already exists, do nothing.