I'm using samsung galaxy s7 and checked it's support hardware-backed 
keystore. (Settings->Security->Credential storage->Storage type)


Then, I tried to generate a new keypair and check with KeyInfo's 
isInsideSecureHardware, but it returns false. 


Why not the key stored in the hardware backed keystore? 


Here is my code:


KeyPairGenerator kpg = KeyPairGenerator.getInstance("EC", 
"AndroidKeyStore");Builder kpgparams = (new Builder(keyname, 
6)).setAlgorithmParameterSpec(new 
ECGenParameterSpec(this.curve)).setDigests(new 
String[]{"SHA-256"}).setUserAuthenticationRequired(false).setUserAuthenticationValidityDurationSeconds(300);
kpg.initialize(kpgparams.build());KeyPair kp = 
kpg.generateKeyPair();:KeyFactory factory = 
KeyFactory.getInstance(privateKey.getAlgorithm(), "AndroidKeyStore");KeyInfo 
keyInfo = factory.getKeySpec(privateKey, KeyInfo.class);boolean secure = 
keyInfo.isInsideSecureHardware();


Thanks for any help

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/b368abad-41ee-441a-913e-8ab89a559c1c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to