We are integrating aerogear java library in our java backend.
We have list of users public key in base64 string. Now when I want to send a
encrypted message to our users.
When we are trying to create a instance of CryptoBox then at that time we
need to provide a instance of PublicKey. How do we create a publickey
Instance from a base64 string or raw bytes.
CryptoBox pandora = new CryptoBox(myprivatekey, userspublickey);
For the normal RSA i found this snippet over internet but i am assuming that
this has to be different for Aerogear.
public static PublicKey loadPublicKey(String stored) throws
byte data = Base64.decode(stored.toCharArray());
X509EncodedKeySpec spec = new X509EncodedKeySpec(data);
KeyFactory fact = KeyFactory.getInstance("RSA");
Any help in this regard is highly appreciated.
View this message in context:
Sent from the aerogear-dev mailing list archive at Nabble.com