Arno Puder wrote:
> 
> Hi,
> 
> certificates and private keys are usually stored in PEM-formatted files
> and are loaded using the functions SSL_CTX_use_certificate_file() and
> SSL_CTX_use_PrivateKey_file().
> 
> If I want to hard code the keys in my application, such as
> 
> char* certificate = "-----BEGIN CERTIFICATE-----"
> "MIIC1...";
> 
> is there an API that I can use in this case to initialize the keys?
> 

For certificates DER format is more efficient. Also look at the -C
option for the 'x509' utility. You can also use the d2i_*() functions to
read from a DER encoded array (see FAQ) you can also convert binary
files to arrays using the Unix xxd utility.

For PEM files in strings you can use a memory BIO: see BIO_s_mem()
manual pages.

Steve.
-- 
Dr Stephen N. Henson.   http://www.drh-consultancy.demon.co.uk/
Personal Email: [EMAIL PROTECTED] 
Senior crypto engineer, Celo Communications: http://www.celocom.com/
Core developer of the   OpenSSL project: http://www.openssl.org/
Business Email: [EMAIL PROTECTED] PGP key: via homepage.


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

Reply via email to