Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Posts: 12
Registered: ‎01-22-2013
My Device: 9900
My Carrier: GiffGaff

InvalidKeyException when trying to create RSAPublicKey object

I am trying to create an RSAPublicKey object using the following code.

RSAPublicKey rsaPublicKey=new RSAPublicKey(cryptoSystem, exponent.getBytes(), (modulus.getBytes());

 It throws an InvalidKeyException .


The exponent and modulus are stored in a file in json format. could any one help? any experts out here with RSA encryption knowledge.?