Sorry for the formatting Lutz, exchange server must be screwed up. anyway, where is the documentation for the d2i functions? and I can't find anything on the SSL_CTX_use_certificate(), where should I be looking? there is no manual page for these functions, as far as I can tell, i must be missing something.... (and please, I don't need no exercise to be left to the reader, I'm screwed up enough as it is already :) regards, -lee -----Original Message----- From: Lutz Jaenicke [mailto:[EMAIL PROTECTED]] Sent: Friday, July 27, 2001 4:12 PM To: '[EMAIL PROTECTED]' Subject: Re: Want to use certs and keys in memory instead of file This is a topic for openssl-users, but I am too lazy to redirect it now! On Fri, Jul 27, 2001 at 03:50:12PM -0400, Dilkie, Lee wrote: > I want to include the ssl cert and private key (copied, pem, from the files) in my >program as static variables (to avoid having files in my file-less application). I'm >staring at SSL_CTX_use_certificate_file() and the other SSL_CTX_use* functions and I >don't see an obvious one that would serve. I'm looking at the >SSL_CTX_use_certificate_file function itself and I see that it uses a file BIO and >calls PEM_read_bio_X509() to decode the PEM into an x.509 structure which is passed >to SSL_CTX_use_certificate(). I suppose I could duplicate the whole function but use >a memory bio instead but I was wondering if any of youse folks out there have a >better (simplier) way? Please use line breaks to improve readibility. Please check out the manual page for SSL_CTX_use_certificate(). The context of the certificate file in nothing else than the ASN1 representation of the X509 object. You can take this data and put it as an array into your program (-C option of openssl X509), then you can use the d2i_X509() function to transfer the contents of this array into the X509 and load it using SSL_CTX_use_certificate(). (OpenSSL rsa does not have a -C option, so transferring it into an array is left as an exercise to the reader :-) Best regards, Lutz -- Lutz Jaenicke [EMAIL PROTECTED] BTU Cottbus http://www.aet.TU-Cottbus.DE/personen/jaenicke/ Lehrstuhl Allgemeine Elektrotechnik Tel. +49 355 69-4129 Universitaetsplatz 3-4, D-03044 Cottbus Fax. +49 355 69-4153 ______________________________________________________________________ OpenSSL Project http://www.openssl.org Development Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED] ______________________________________________________________________ OpenSSL Project http://www.openssl.org Development Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]
