You can do something like this: (assuming the cert is a variable -- if the
cert is a file in the filesystem, some modificatins is needed)

#include ...

int main(int argc, char **argv)
{
        X509* pCert;
        char* str;
        int ret;
char clientCertificate[] = "-----BEGIN CERTIFICATE-----\r\n\

// the PEM certificate data

-----END CERTIFICATE-----";

        BIO* mem = BIO_new_mem_buf(clientCertificate,
strlen(clientCertificate));
        pCert = PEM_read_bio_X509(mem,NULL,NULL,NULL);

        str =X509_NAME_oneline (X509_get_issuer_name(pCert),NULL,0);

        printf ("\t Issuer: [%s]\n", str);

        BIO_set_close(mem,BIO_NOCLOSE);
        BIO_free(mem);
        return 0;
}

  -----Original Message-----
  From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of imin macho
  Sent: Wednesday, November 29, 2006 12:26 PM
  To: [email protected]
  Subject: get CA name from user certificate


  hi

  i'm really new to this openSSL thingy. is there any function we can use to
read/extract CA's name from client certificate? thank you.

DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the 
property of Persistent Systems Pvt. Ltd. It is intended only for the use of the 
individual or entity to which it is addressed. If you are not the intended 
recipient, you are not authorized to read, retain, copy, print, distribute or 
use this message. If you have received this communication in error, please 
notify the sender and delete all copies of this message. Persistent Systems 
Pvt. Ltd. does not accept any liability for virus infected mails.

Reply via email to