Hi
 
I have a X509 certificate I want to read into a X509 structure. When I do
the following SSL command:
  openssl x509 -inform DER -in d:\certs\test.der -pubkey
it displays the valid Public key etc.

Now I use the following to read the certificate:

X509 * x509 = NULL;

FILE * file = fopen(fileName, "r");
if(file != NULL) {
        x509 = d2i_X509_fp(file, NULL);
        if(x509 == NULL) {
                ...
        } else {
                ...
        }
} else {
        ...
}
 
The problem is that d2i_X509_fp returns NULL. Should I specify that the file
is DER encoded (similar to -inform DER of the OpenSSL command)

Regards
Alfred

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

Reply via email to