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

Native Development

Reply
New Contributor
grotta
Posts: 6
Registered: ‎08-23-2013
My Device: Z10
Accepted Solution

RSA Encrypt

Hi, I need an example of RSA implementation.

As the web page shows i need the implementation of:

1. hu_RSAParamsCreate

2. hu_RSAKeyGen

3. hu_RSAPublicEncrypt / hu_RSAPrivateEncrypt

 

I can't get those classes to work.

 

I made this process works in Javascritp, but now i need someting similar in QT C++ 

 

    var rsa= new RSAKey();
    rsa.readPrivateKeyFromPEMString(pk);
    var hSig=rsa.signString(s,"md5");
    return hex2b64(hSig);

Please, any help will be welcome! 

 

Thanks!

Retired
mwoolley
Posts: 571
Registered: ‎06-25-2010
My Device: Z10

Re: RSA Encrypt

I don't have examples of using these RSA functions to hand, but I think you should be able to see how to use them if you read the KB article: http://supportforums.blackberry.com/t5/Native-Development-Knowledge/BlackBerry-10-Using-one-way-encr...

 

This uses the same crypto framework and the different use cases require very similar code.

 

The Security Builder User Guide is the other place to look:

 

http://developer.blackberry.com/native/documentation/core/com.qnx.doc.crypto/topic/c_sb_ug_overview....

 

 

 

Hope this helps.

 

Martin

--------------------------------------------------------------------------------------------
Feel free to press the like button on the right side if you liked my attempts to help :-)
And please mark posts as solved if you think I found the solution or set you on its path. Thanks!
Follow me on Twitter: @mdwrim
New Contributor
grotta
Posts: 6
Registered: ‎08-23-2013
My Device: Z10

Re: RSA Encrypt

Thanks for your help, that was my point to start, but RSA uses more complex function I think.

Now i'm checking an AES demo at https://github.com/blackberry/Cascades-Community-Samples/tree/master/AESCryptoDemo

 

This example uses some similar functions. 

 

New Developer
tushar886
Posts: 75
Registered: ‎08-15-2013
My Device: blackberry curve 9630

Re: RSA Encrypt

Hi,

 

THe AES code exmaple is fine but is there any location where i can find the RSA code for blackberry 10 cascades.

 

Please provide if its there.

 

Thanks & Regards,

Tushar

Retired
robbieDubya
Posts: 418
Registered: ‎07-18-2012
My Device: Q10

Re: RSA Encrypt

Hi,

 

I'm planning on adding RSA functionality to my AESCrypto sample.

 

The name of the sample isn't going to make much sense anymore... but that's my plan...

 

Thanks!

--
Rob is no longer associated with BlackBerry.
New Developer
tushar886
Posts: 75
Registered: ‎08-15-2013
My Device: blackberry curve 9630

Re: RSA Encrypt

Hi,

 

Can you please share the code once its done.

 

Thanks & Regards,

Tushar

Retired
robbieDubya
Posts: 418
Registered: ‎07-18-2012
My Device: Q10

Re: RSA Encrypt

Will do - it can take a while for our open source reviews though...

--
Rob is no longer associated with BlackBerry.