Frank Geck wrote: > > Thanks, Yea I already had this output/used this code. Was tring to just get > the CN=XXX without doing something lame like strtoking through text. I was > loking at the code of X509_NAME_oneline and it is sure ugly! >
X509_NAME_print_ex() is the newer version but its rather complex to handle all manner of issues. Anyway what you need to do is to use the X509_NAME functions to extract the CN. An example of their use appears in crypto/x509v3/v3_utl.c in the function get_email which handles email. However for a CN you'll get back an ASN1_STRING structure which will usually be a simple string type like PrintableString but may be a multi character type like BMPString or UTF8String. Steve. -- Dr Stephen N. Henson. http://www.drh-consultancy.demon.co.uk/ Personal Email: [EMAIL PROTECTED] Senior crypto engineer, Gemplus: http://www.gemplus.com/ Core developer of the OpenSSL project: http://www.openssl.org/ Business Email: [EMAIL PROTECTED] PGP key: via homepage. ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]