CN=Joe Bloggs&quot;</p>

<pre><code> X509_NAME *nm;

 nm = X509_NAME_new();
 if (nm == NULL)
     /* Some error */
 if (!X509_NAME_add_entry_by_txt(nm, &quot;C&quot;, MBSTRING_ASC,
                                 &quot;UK&quot;, -1, -1, 0))
     /* Error */
 if (!X509_NAME_add_entry_by_txt(nm, &quot;O&quot;, MBSTRING_ASC,
                                 &quot;Disorganized Organization&quot;, -1, -1, 0))
     /* Error */
 if (!X509_NAME_add_entry_by_txt(nm, &quot;CN&quot;, MBSTRING_ASC,
                   