On Tue, Sep 07, 2004, Niklas Olsson wrote: > > maybe I have misunderstood but I havn't encrypted the data yet > I'm trying to understand how to read my certificate so I can get the RSA > *rsa to point to the public key in the certicate so I am able to encrypt my > data. The certificate comes to me in a TLS serverhello message and I just > want to encrypt the pre master key and send it back... >
Then d2i_X509() will get you an X509 structure and X509_get_pubkey() will produce an EVP_PKEY structure. >From that you can call EVP_PKEY_get1_RSA() to retrieve the RSA structure containing the public key which you can use with the RSA_*() functions. Steve. -- Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage OpenSSL project core developer and freelance consultant. Funding needed! Details on homepage. Homepage: http://www.drh-consultancy.demon.co.uk ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]