Reputation: 11078
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?
Upvotes: 2
Views: 5031
Reputation: 61952
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));
Upvotes: 9
Reputation: 133
I am not sure, but try Bouncy castle library https://www.bouncycastle.org/java.html
Several mounth ago I also had same issue as you, and I successfully solved it by using AES cryptyng alghoritm
Upvotes: 0