Ambarish Mitra wrote:
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);
Using of X509_NAME_oneline() is discouraged(See the man page). Instead
use X509_NAME_print_ex(out, X509_get_issuer_name(pCert), 0,0);
as in my previous reply.
Cheers,
Kau

        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.


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [email protected]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to