Hello,

 

I'm making a client/server application with SSL certificate using Openssl 
libraries. I have generated a PEM certificate file that the server reads, 
transform to bio structure and then into PKCS12. I call the PKCS12_parse 
function to get pkey and cert structures, however some fields (X509 * x; 
x->cert_info->version->data, x->cert_info->version->serialNumber) contain 
garbage and this information is required by the client when establish 
connection through sockets.

 

My code:

 

BIO *in = BIO_new(BIO_s_file());



BIO_read_filename(in, (void*) "cacert.p12")

PKCS12 *p12 = d2i_PKCS12_bio(in, NULL);

PKCS12_parse(p12, "ppppp", pkey, cert, NULL)

 

Any suggestion?

Thanks.

_________________________________________________________________
Nuevo Windows Live, un mundo lleno de posibilidades. Descúbrelo.
http://www.microsoft.com/windows/windowslive/default.aspx

Reply via email to