react-native-keychain icon indicating copy to clipboard operation
react-native-keychain copied to clipboard

Why is accessControl.DEVICE_PASSCODE not supported on Android?

Open dafuga opened this issue 3 years ago • 3 comments

Hey guys,

I was wondering why the "DEVICE_PASSCODE" accessControl doesn't seem to be supported for Android devices? From the documentation, it seems that fingerprint and none are the only two authentication options by design. However, it seems like the "setUserAuthenticationParameters" keystore method lets you pass a type param which can be set to "AUTH_DEVICE_CREDENTIAL" requiring that the user input his password on key retrieval.

https://developer.android.com/reference/android/security/keystore/KeyGenParameterSpec.Builder#setUserAuthenticationParameters(int,%20int)

Thanks, Daniel

dafuga avatar Apr 03 '21 00:04 dafuga

This issue seems to be related, but it doesn't look like it was ever addressed by the devs.

dafuga avatar Apr 03 '21 00:04 dafuga

@dafuga The API you refer to is only available in Android 11. Before that device credential cannot be used for crypto operations.

sgal avatar Apr 14 '21 08:04 sgal

Thanks @sgal ! That's good to know! Are you guys still planning on adding it as an option for Android 11 devices?

dafuga avatar Aug 09 '21 05:08 dafuga