Android CryptographyManager使用的secretKeyName是什么?
I集成生物特征认证遵循此指南()。我有一个关于秘籍的问题Android CryptographyManager使用的secretKeyName是什么?,android,biometrics,android-biometric-prompt,android-authenticator,Android,Biometrics,Android Biometric Prompt,Android Authenticator,I集成生物特征认证遵循此指南()。我有一个关于秘籍的问题 private fun showBiometricPromptForEncryption() { val canAuthenticate = BiometricManager.from(applicationContext).canAuthenticate() if (canAuthenticate == BiometricManager.BIOMETRIC_SUCCESS) { val secretKeyNam
private fun showBiometricPromptForEncryption() {
val canAuthenticate = BiometricManager.from(applicationContext).canAuthenticate()
if (canAuthenticate == BiometricManager.BIOMETRIC_SUCCESS) {
val secretKeyName = "biometric_sample_encryption_key"
cryptographyManager = CryptographyManager()
val cipher = cryptographyManager.getInitializedCipherForEncryption(secretKeyName)
val biometricPrompt =
BiometricPromptUtils.createBiometricPrompt(this, ::encryptAndStoreServerToken)
val promptInfo = BiometricPromptUtils.createPromptInfo(this)
biometricPrompt.authenticate(promptInfo, BiometricPrompt.CryptoObject(cipher))
}
}
private fun showBiometricPromptForDecryption() {
ciphertextWrapper?.let { textWrapper ->
val secretKeyName = getString(R.string.secret_key_name)
val cipher = cryptographyManager.getInitializedCipherForDecryption(
secretKeyName, textWrapper.initializationVector
)
biometricPrompt =
BiometricPromptUtils.createBiometricPrompt(
this,
::decryptServerTokenFromStorage
)
val promptInfo = BiometricPromptUtils.createPromptInfo(this)
biometricPrompt.authenticate(promptInfo, BiometricPrompt.CryptoObject(cipher))
}
}
我的问题是什么是secretKeyName
?加密提示中的secretKeyName
是否与解密提示相同?如何获得该值
谢谢