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.