Click here to Skip to main content
15,889,526 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
The following code snippets are from OpenSSL websites.

C++
//Process all entries.

int i;
 X509_NAME_ENTRY *e;

 for (i = 0; i < X509_NAME_entry_count(nm); i++)
        {
        e = X509_NAME_get_entry(nm, i);
        /* Do something with e */
        }


C++
//Process all common names.
int loc;
 X509_NAME_ENTRY *e;

 loc = -1;
 for (;;)
        {
        lastpos = X509_NAME_get_index_by_NID(nm, NID_commonName, lastpos);
        if (lastpos == -1)
                break;
        e = X509_NAME_get_entry(nm, lastpos);
        /


I wish to get entries such as Common Name, Country, Organisation etc.

How do I get them from the X509-NAME-ENTRY structure that is returned from the code snippets above. Or is there a better way to go about getting the said entries?

What I have tried:

I am yet to find any useful result from google search.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900