Hi everyone,

I would like to load a certificate from file into a X509 struct without too
much hassle. (I found something for which I have specific questions below,
but if you know another way, then please tell me that as well.)

I found the PEM_read_X509 macro and figured that it might do for me what I
want. I just have some trouble figuring the parameters out.

This is the definition (after you resolve the macro):

(X509 *) PEM_read_X509( FILE *fp, X509 **x, pem_password_cb *cb, void *u );

These I figured out:
- fp  is most likely an open file pointer to the certificate file.
- x   is most likely a double pointer to an X509 struct.

But what is a pem_password_cb and what do I do with it?
It is defined as:
    typedef int pem_password_cb(char *buf, int size, int rwflag, void
*userdata);
And what is this void *u at the end supposed to do??

Any help, or even better: an example, would be greatly appreciated!!

Thanks,
Radboud

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

Reply via email to