On Wed, Aug 11, 2004, Areg Alimian wrote:

> Hi Steve,
> 
> Thank you for the quick response!  There are indeed lots of options on the
> output format.  Now if I just want to extract the common field string, do I
> search for "CN=" prefix or is there a better way?
> 

Its not a good idea to attempt to parse any human readable output since the
format may change over time.

Your best option is to use X509_NAME_get_index_by_NID() (there's an example
in the manual page for commonName) then X509_NAME_ENTRY_get_data() followed
possibly by ASN1_STRING_to_UTF8().

Steve.
--
Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage
OpenSSL project core developer and freelance consultant.
Funding needed! Details on homepage.
Homepage: http://www.drh-consultancy.demon.co.uk
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to