Welcome!

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

Reply
Highlighted
New Developer
Posts: 20
Registered: ‎04-11-2009
My Device: Not Specified

UnsupportedCryptoSystemException while RSACryptoSystem construction

Hello, forum

 

I am trying to cypher data using RSA algorithm as follows:

  

String eStr = "010001";

String mStr = "longlongstring"; 

 

byte[] e = eStr.getBytes();

byte[] m = mStr.getBytes();

 

RSACryptoSystem cs = new RSACryptoSystem(); 

RSAPublicKey key = new RSAPublicKey(cs, e, m); 

 

Exception is throwed in RSACryptoSystem constructor internals is "unreported exception net.rim.device.api.crypto.UnsupportedCryptoSystemException; must be caught or declared to be thrown"

 

How can this be fixed? Probably I'm doing something wrong and there is another way to generate RSAPublicKey.

Any thoughts are appreciated.

 

Thanks,

Mikhail 

Developer
Posts: 1,477
Registered: ‎12-30-2008
My Device: Torch 9810

Re: UnsupportedCryptoSystemException while RSACryptoSystem construction

I never used encryption in blackberry, but I know a bit about that and used or implemented in standard java .. Smiley Tongue But the problem is not in that

 

You have to surround your code with try catch like

 

 

try
{
//Your code goes here
}
catch(UnsupportedCryptoSystemException ucse)
{
ucse.printStackTrace();
}

Thanks!
--
Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group
New Developer
Posts: 20
Registered: ‎04-11-2009
My Device: Not Specified

Re: UnsupportedCryptoSystemException while RSACryptoSystem construction

It just throws more and more exceptions then and I can't see any stack traces.