AndroidKeystore NoSuchAlgorithm exception

Viewed 5256

I am trying to initialize a Cipher object for encryption and decryption.

String cipher = privateKey.getAlgorithm() + "/ECB/PKCS1Padding";
        mCipher = Cipher.getInstance(cipher, "AndroidKeyStore");

I keep getting the following exception on android:

    System.err: java.security.NoSuchAlgorithmException: Provider   AndroidKeyStore does not provide RSA/ECB/PKCS1Padding
   03-20 00:28:38.270 19817 21488 W System.err:     at javax.crypto.Cipher.getCipher(Cipher.java:357)
   03-20 00:28:38.270 19817 21488 W System.err:     at javax.crypto.Cipher.getInstance(Cipher.java:325)
   03-20 00:28:38.271 19817 21488 W System.err:     at javax.crypto.Cipher.getInstance(Cipher.java:297)
1 Answers
Related