On Tue, Mar 11, 2003 at 01:54:55PM -0800, rajagopalan ramanujam wrote: > hi, > > I am having a problem when reading a certificate and > private key from a memory buffer instead of a file. > i am using d2i_X509(NULL,&cert,strlen(cert)) to read > the certificate string which was defined in one of > .pem > file. Should i use SSL_CTX_use_certificate_ASN1 > instead??? Please help me..... > > copied from server.pem file > unsigned char * cert > ="MIIDDzCCAs2gAwIBAgICA............Qw=="; > unsigned char * key = > "y5qH6Q0Nvb5SUcJEYY...........p6==";
Your data are in PEM format (the data is ASCII-armored with BASE64). The d2i_ functions require the data to be in ASN.1 (DER) format. You must therefore first decode from the BASE64 armoring. Best regards, Lutz -- Lutz Jaenicke [EMAIL PROTECTED] http://www.aet.TU-Cottbus.DE/personen/jaenicke/ BTU Cottbus, Allgemeine Elektrotechnik Universitaetsplatz 3-4, D-03044 Cottbus ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]