forCurrentPlatform
Creates biometric-protected storage isolated by serviceName and accountName.
Each namespace has one non-exportable Android Keystore RSA key whose private key can only be used after a Class 3 biometric authentication and is invalidated when biometric enrollment changes. Every entry is encrypted with a fresh AES-256-GCM key that the RSA public key wraps, so ProtectedKeychain.write needs no prompt. Ciphertext lives under Context.getNoBackupFilesDir and is never backed up.
val protected = ProtectedKeychain.forCurrentPlatform(
context = applicationContext,
activity = { currentActivity },
serviceName = "my-app",
accountName = "user-123",
)Parameters
any Android Context; only its application context is retained.
returns the FragmentActivity that hosts the prompt, called on the main thread for each ProtectedKeychain.read. Return the currently resumed activity rather than capturing one, so the store does not leak it. A null result fails the read with Reason.Failed.
identifies the calling application or integration; must be nonblank and free of NUL/CR/LF.
identifies the credential owner. Same validity rules as serviceName.
Throws
if serviceName or accountName is blank or contains NUL, CR, or LF.