Hi All,

I have a client server application where the client is developed in
Objective-C on MAC platform and the server application in Java.
The client is supposed to generates an RSA key pair and send the public key
to the server. The server inturn uses the public key to encrypt some secure
data and sent it to client for it to decrypt using it's private key.

I plan to use OpenSSL for the generation of the asymmetric key pair ( I
could not find any native api's in OSX for this purpose). But the only
problem that I currently face is that the key pair generated by OpenSSL has
headers and footers of the form -----BEGIN RSA PUBLIC KEY----- -----END RSA
PUBLIC KEY----- for public key likewise there is similar header and footer
for private key as well.

The server whose implementation I dont control accepts only the key part and
I need to clip of the headers and footers before sending the raw public key
to the server.

On receiving the data encrypted with the public key, when I try to decrypt
the data using the private key pair, the decryption fails.  (This could be
because I had stripped the header and footer of the public key and with
this, they are no longer public/private key pairs hence the decryption
fails).

Is there a mechanism by which I can generate an RAS Public/Private Key pair
without the header and footer?.
Alternatively, if i have an valid public/private key pair previously
generated using OpenSSL, can I stripping of the header and footer and then
using the key pair to generate an RSA object? With this I believe I can
easily decrypt using the private key as the public key used to encrypt would
not have had the header/footer.

Or is there an better alternative to resolve the issue that I am facing?

Thanks & Regards.



--
View this message in context: 
http://openssl.6102.n7.nabble.com/RSA-encryption-decryption-with-OpenSSL-tp46234.html
Sent from the OpenSSL - User mailing list archive at Nabble.com.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to