I get some warnings due to use of RSAPublicKeyImpl:
warning: RSAPublicKeyImpl is internal proprietary API and may be removed in a future release import sun.security.rsa.RSAPublicKeyImpl;
I have tried to find a replacement, but with no luck. What is the open source alternative for this class?
class RSAPublicKeySpec supports at least a part of the implementation that you're looking for. Namely it can be created from the exponent and modulus as BigInteger.
You can use this to get an RSAPublicKey from an encoded byte[]:
RSAPublicKey publicKey = (RSAPublicKey)KeyFactory.getInstance("RSA").generatePublic(
new X509EncodedKeySpec(bytes));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With