Hi,

Presently I am using the certificate authentication for one application.
In that one,am reading the certificate thru C program.
In that program am using the function called X509_get_ext_d2i.
When I am trying to retrieve the value of the extension serialNumber , it is
throwing the error it couldn't find the extension serialNumber in the
certificate.
But in the certificate the serialNumber is available.Am bit confused why it
is throwing this kind of error?
And my code looks like below.

=====================
 nid=OBJ_sn2nid(trimmedExtensionName);
                if(nid == FALSE)
                {
                        fprintf(stderr,"Unable to get the NID for
%s\n",trimmedExtensionName);
                        return FALSE;
                }

altnames = (STACK *)X509_get_ext_d2i(cert, nid, crit, idx);
===========================

In the above scenario first I am getting the nid of the extension by passing
the extension name.
In the second step, using the NID am getting the value of the extension.

This code working fine for subjectalternativename extension.

In case anybody knows about this please let me know.

Regards
Sunil.
-- 
View this message in context: 
http://www.nabble.com/Regarding-the-X509_get_ext_d2i-tp14687179p14687179.html
Sent from the OpenSSL - User mailing list archive at Nabble.com.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to