How to create a certificate request with XENROLLLib and .NET
<pre><code>I've created CSR using XENROLLLib which is as follows.
</code></pre>

<p>//use first to import the APIs DLLs:
    using XENROLLLib;`</p>

<pre><code>using CERTCLIENTLib; //CERTCLIENTLib.dll allready regestred for XP


int creationState;
string CertificateTemplate = "your Template Name";
string ProviderName ="Microsoft Enhanced Cryptographic Provider v1.0";
string EmailCertOID = "1.3.6.1.5.5.7.3.4" ; //Email Certificate
</code></pre>

<p>// creating cert request:</p>

<pre><code>try
{
 XENROLLLib.CEnroll certEnroll = new XENROLLLib.CEnroll();

 certEnroll.GenKeyFlags = 1024 * (256*256); //KEY

 certEnroll.GenKeyFlags = CRYPT_EXPORTABLE;

 certEnroll.UseExistingKeySet = 0;

 certEnroll.EnableSMIMECapabilities=1;

 certEnroll.addCertTypeToRequest (CertificateTemplate);

 certEnroll.ProviderName =ProviderName;

 //certEnroll.PVKFileName = @"C:\pvk1.pvk"; //if you need to export the private key   (not req. because you generate

 string dn = "CN="+ CommonName.txt +",E="+ Email.Text +",O="+ Organisation.Text   +",L="+ City.Text +",S="+ State.Text +",C="+Countrycode.Text+"";

  string req = certEnroll.createPKCS10(dn, EmailCertOID); //create the Request 
</code></pre>

<p>Now my question is what are methods available into XENROLL DLL through which i can send this to CA server?</p>
