AppPinAuthenticator

class AppPinAuthenticator(val cryptoKey: CryptoKey, val keyStoreRepository: KeyStoreRepository = EncryptedFileKeyStore(cryptoKey.keyAlias))

An authenticator to authenticate the user with Application Pin

Constructors

Link copied to clipboard
constructor(cryptoKey: CryptoKey, keyStoreRepository: KeyStoreRepository = EncryptedFileKeyStore(cryptoKey.keyAlias))

Properties

Link copied to clipboard
private val cryptoKey: CryptoKey
Link copied to clipboard
Link copied to clipboard
private val keyStoreType: String

Functions

Link copied to clipboard
fun exists(context: Context): Boolean

Checks if the given alias exists in this keystore.

Link copied to clipboard
private fun generateCertificate(keyPair: KeyPair, subject: String): X509Certificate
Link copied to clipboard
fun generateKeys(context: Context, pin: CharArray): KeyPair

Generate KeyPair, and persist the KeyPair to provided KeyStoreRepository

Link copied to clipboard

Return the key alias

Link copied to clipboard
private fun getKeyStore(context: Context, pin: CharArray): KeyStore
Link copied to clipboard

Unlock the PrivateKey with the provided application pin

Link copied to clipboard
private fun persist(context: Context, keyPair: KeyPair, pin: CharArray)