11-11-2009 03:29 AM
I'm facing some problem in RSA encryption. Basically my application based on client server based and the server side is developed in C++ and there Crypto++ library has been used for crypto. I'm getting the servers public key in byte format. Now I've to initialize(create the object of RSAPublicKey) the public key in the device. So, my first question:
1. Is it possible to create an object of 2048 bit RSAPublicKey from the total byte data of the Public Key? If possible a sample code snip will of great help.
Secondly, I can also get the PublicExponent and the modulus of the public key. But while trying to encrypt the data using the RSAPublicKey generated by those PublicExponent and the modulus, the resulting encrypted data in not proper (I've the encrypted data to ckeck if the encryption is doing perfect).
Please help me with some sample code.
Thanks in advance.
11-16-2009 01:59 PM
1. You simply need to pass the modulus and the public exponent to the constructor of RSAPublicKey. I guess the public key you are using in C++ is encoded, most likely, in DER. So, you need to extract the modulus and public exponent from that container (e.g., ASN1InputByteArray might work).
2. Check whether the public exponent and modulus are identical on both sides. Check whether you are using some padding scheme in your C++ code.
11-23-2009 07:38 AM
I am also facing the same problem, i follow the solution suggested by Klyubin, but i got ASN1EncodingException.
Can someone tell cause of this, and any solution this?
10-10-2012 12:02 PM
Hi. I'm new working with Blackberry10 and I have t
I've seen several methods in the page but none of
Any help will be appreciated. Any at all. Like I s
Thanks to all and best regards.
PD: sorry for posting in this thread but I'm kind of desperate right now for finding some info or examples about it.