Hi Jerry,

Thus wrote Jerry Wang (jerry...@gmail.com):

> Does OpenSSL have a function for getting the common name from a X509
> certificate?

how about something like

X509 *cert;
X509_NAME *subjectName;
char  subjectCn[256];
   
subjectName = X509_get_subject_name(cert);
X509_NAME_get_text_by_NID(
    subjectName, NID_commonName, subjectCn, sizeof(subjectCn));


plus some error checking, of course...

Regards,

   Martin
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to