Hi,
I have been look through this mailing list to try to understand how to read the public key and encrypt my message.


so far I think I should use

PEM_read_bio_RSAPublicKey
and
RSA_public_encrypt

I get the certificate in a buffer from the server (TLS - ServerHello message)

I would think I should use
BIO *in=NULL;
in = BIO_new_mem_buf(cert, 1558); //cert if the buffer with the certifiate
RSA *pKey=NULL;
pKey = PEM_read_bio_RSAPublicKey(in,NULL, NULL, NULL);

but pKey is always NULL, I thought maybe the in buffer should only be the public key so I copied that only, but again I only get a pKey that is NULL.

How am I supposed to read my certificate and get a correct RSA *pKey?

thanks!

_________________________________________________________________
Chat: Ha en fest på Habbo Hotel http://habbohotel.msn.se/habbo/sv/channelizer Checka in här!


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to