i got CA cert in header file declarated  like this

unsigned char s_pbCaCertificate[] = {
 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43,
0x45, 0x52, 0x54, 0x49,
 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d...};

(this buffer i`ve  made it form PEM  cert file and from DER, no difference
in my attemps to load it )

i try to load it  like this
#####
X509 * p_CACert;
 unsigned char * p_Buf;
 int CertSize=sizeof(s_pbCaCertificate);
 p_Buf=s_pbCaCertificate;
 p_CACert=NULL;

 p_CACert=d2i_X509(NULL,&p_Buf,CertSize);
##########
but p_CACert  always remains NULL, according docs that means that some error
occured while attempt to decode s_pbCaCertificate. But i dont know why?
Second time I used such code
####
X509 * p_CACert;
 unsigned char * p_Buf;
 int CertSize=sizeof(s_pbCaCertificate);
 p_Buf=s_pbCaCertificate;
 p_CACert=NULL;

d2i_X509(& p_CACert,&p_Buf,CertSize);
#####
But result was the same,  p_CACert was NULL.
So how can i load it? Where is my error? And what  cert form (PEM or DER)  i
must use?

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

Reply via email to