List of usage examples for android.security KeyChain isBoundKeyAlgorithm
@Deprecated public static boolean isBoundKeyAlgorithm(@NonNull @KeyProperties.KeyAlgorithmEnum String algorithm)
From source file:com.example.android.vault.VaultProvider.java
@Override public boolean onCreate() { mHardwareBacked = KeyChain.isBoundKeyAlgorithm("RSA"); mKeyFile = new File(getContext().getFilesDir(), "vault.key"); mDocumentsDir = new File(getContext().getFilesDir(), "documents"); mDocumentsDir.mkdirs();/* w w w .j a v a 2s . c o m*/ try { // Load secret key and ensure our root document is ready. loadOrGenerateKeys(getContext(), mKeyFile); initDocument(Long.parseLong(DEFAULT_DOCUMENT_ID), Document.MIME_TYPE_DIR, null); } catch (IOException e) { throw new IllegalStateException(e); } catch (GeneralSecurityException e) { throw new IllegalStateException(e); } return true; }