android.security.KeyStoreException: Invalid key blob
问题 I cannot obtain a (private) key from KeyStore on Android. Problem occurs mainly on Samsung devices (S6, S6 Edge) and Android 6. android.security.KeyStoreException: Invalid key blob is thrown when following line is called (where alias is name for store key). KeyStore.PrivateKeyEntry privateKeyEntry = (KeyStore.PrivateKeyEntry)keyStore.getEntry(alias, null); The KeyStore itself is obtained by KeyStore.getInstance("AndroidKeyStore"); And key is generated by the following method: private static