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
Developer
alessandra89
Posts: 21
Registered: ‎07-31-2011
My Device: developer
My Carrier: student
Accepted Solution

Help with RSA cryptography

Hi,

i have Blackberry Bold 9000, os 5.

This code works on the simulator, instead launching it on the device it gives me NullPointerException :

 

 

 

public RSAKeyPair generateKey() throws NoSuchAlgorithmException, UnsupportedCryptoSystemException, CryptoTokenException, CryptoUnsupportedOperationException, KeyStoreRegisterException{

        RSACryptoSystem rsaCryptoSystem = new RSACryptoSystem(1024);
        // Create an RSA key pair.
        RSAKeyPair keys = new RSAKeyPair( rsaCryptoSystem );       
        return keys;
    }   
        

 

 

On the device this method returns null...why?

Please use plain text.
Administrator
MSohm
Posts: 14,444
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Help with RSA cryptography

What version of BlackBerry Java SDK are you using?  Is it 5.0 or lower?

 

Appropriate version of the BlackBerry JDE and BlackBerry Java SDK

http://supportforums.blackberry.com/t5/Java-Development/Appropriate-version-of-the-BlackBerry-JDE-an...

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Developer
alessandra89
Posts: 21
Registered: ‎07-31-2011
My Device: developer
My Carrier: student

Re: Help with RSA cryptography

Thanks for the reply,
I use java sdk version 5.0.0.
However i found this article:
http://docs.blackberry.com/en/smartphone_users/deliverables/14836/Generate_an_encryption_key_50_7780...


I haven't an email account. Is this the problem?

Please use plain text.
Administrator
MSohm
Posts: 14,444
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Help with RSA cryptography

I wasn't able to reproduce this.  Do you get any error or exception in your application?  Check the device logs for errors.  To extract them use javaloader.

 

javaloader -u eventlog > mylog.txt

 

What is the full, 4 digit BlackBerry Device Software version you are testing on?

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Developer
streak81
Posts: 204
Registered: ‎08-09-2010
My Device: 9930, PlayBook
My Carrier: Verizon Wireless

Re: Help with RSA cryptography

Did you apply for and install the RIM crypto signing keys?  There should have been an option when you were signing up for your code signing keys to also request the crypto signing keys.  You need your app signed with those signing keys to use RSA.

Please use plain text.
Developer
alessandra89
Posts: 21
Registered: ‎07-31-2011
My Device: developer
My Carrier: student

Re: Help with RSA cryptography

i'm testing on blackberry 9000 bold, os 5.0.0.592
the blackberry java sdk version is 5.0.0.25

It gives me no error neither exception

Please use plain text.
Developer
alessandra89
Posts: 21
Registered: ‎07-31-2011
My Device: developer
My Carrier: student

Re: Help with RSA cryptography

[ Edited ]

i solved the problem!
i got RBB, RRT and RCR signing keys and last week i asked for the RCC one, because i thought it could solve my problems, even if i got no exception in my application...
now i've just installed the RCC key and everything works!
thanks a lot! :Clap:

Please use plain text.