On Tue, Mar 02, 2004, Florian Millet wrote: > Hi all, > > I'd like to be able to print/check content of a certificate but the checking > would be verifying the data entered at certificate generation. I'd like to > be able to extract the fields in a string like : > "/C=FR/ST=Paris/L=Paris/O=Test/OU=None/CN=Test > Certificate/[EMAIL PROTECTED]" How is it possible ? i must use > a X509_Name structure right ? but how can i load a certificate from a file > into such a structure ? it seems there is no PEM* function capable of > generating a X509_Name structure. I can load a file into a X509 *, that is > the easy part but where to go from there ? >
Well X509_NAME. You can get the subject and issuer names from the X509 structure using X509_get_issuer_name() and X509_get_subject_name(). If you want to print the textual format of the name you can use X509_NAME_print_ex(). If however you want to parse and examine the fields you should instead use the X509_NAME utilities such as X509_NAME_get_index_by_NID() etc. 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]