Deprecated interfaces?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Deprecated interfaces?

Uri Blumenthal
My code has been using objects like ECPrivateKey for a long time. With 1.57 I’ve noticed this warning message:

- Access restriction: The type 'ECPrivateKey' is not API (restriction on required library '/Library/Java/

What type should I use instead of, e.g., ECPrivateKey? And may I ask why it is deprecated?


P.S. Here’s an example of how I use it:

PKCS8EncodedKeySpec pkcs8KeySpec = new PKCS8EncodedKeySpec(keyBytes);
KeyFactory kf = KeyFactory.getInstance("EC", "BC");

ECPrivateKey priKey = (ECPrivateKey) kf.generatePrivate(pkcs8KeySpec);

// decrypt the data
Cipher cipher =  Cipher.getInstance(ALGORITHM, "BC");
cipher.init(Cipher.DECRYPT_MODE, priKey, rng);

Uri Blumenthal

smime.p7s (3K) Download Attachment