On Wed, Dec 21, 2011, chetanrun wrote: > > How to read certificate details ( serial number, issuer , subject details) > from x509 certificate using Openssl. > > I parsed P12 file using PKCS12_parse(), then retrieved serial number in > ASN1_INTEGER format from objtained x509 certificate. But how do I parse it > so that it can be read. >
There are several ways to handle this. One is to convert it to a BIGNUM using ASN1_INTEGER_to_BN(). Alternatively you can use ASN1_STRING_data, ASN1_STRING_length and ASN1_STRING_type. This will return an internal buffer pointer containing the value in big endian format. If the type returned is V_ASN1_NEG_INTEGER the result is negative. Steve. -- Dr Stephen N. Henson. OpenSSL project core developer. Commercial tech support now available see: http://www.openssl.org ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager majord...@openssl.org