Hi,
I am new to Android development and am trying to implement a simple application that does elliptic curve cryptography using the BouncyCastle libraries, which I understand that Android supports.
I have the following line of code that I use to get an instance of a KeyFactory object that works on my laptop but throws an NoSuchAlgorithmException when I try running on my Nexus One Android phone (running SDK 2.1):
I am new to Android development and am trying to implement a simple application that does elliptic curve cryptography using the BouncyCastle libraries, which I understand that Android supports.
I have the following line of code that I use to get an instance of a KeyFactory object that works on my laptop but throws an NoSuchAlgorithmException when I try running on my Nexus One Android phone (running SDK 2.1):
What should I do get an instance of KeyFactory that supports ECKey generation? Or is there some other way to create an ECKey object?PKCS8EncodedKeySpec privateKeySpec = new PKCS8EncodedKeySpec(encodedKey);
KeyFactory kf = KeyFactory.getInstance("ECDH", "BC"); // throws NoSuchAlgorithmException() - "KeyFactory ECDH implementation not found"
ECPrivateKey pk = (ECPrivateKey) kf.generatePrivate(privateKeySpec);