Request Client Certificate Problem

From: Dimitris Katsikas (d.katsikas@altanet.gr)
Date: 08/29/02


From: "Dimitris Katsikas" <d.katsikas@altanet.gr>
Date: Thu, 29 Aug 2002 14:51:32 +0300

I am using the following code to generate and retrieve a client certificate. In a simple WinForms application, the same code works fine and sends the certificate request to the Windows 2000 Advanced Server Certification Services. However, copy+paste to the OnLoad function of a WebForm, it crashes and throws a FileNotFoundException (?...). The code does not attempt to locate or generate a file...

Please help.

CCertRequest objReq = new CCertRequestClass();
CEnroll objEnroll = new CEnrollClass();
string strDN = "CN=" + "Katsikas Dimitris 5" +
",O=" + "Altanet Corp. 5" +
 ",OU=" + "Altanet Sec. 5" +
 ",L=" + "Thessaloniki 5" +
 ",S=" + "Thessaloniki 5" +
 ",C=" + "GR" +
 ",E=" + "dimitris5@altanet.gr";

string strPKCS10 = objEnroll.createPKCS10(strDN,"1.3.6.1.4.1.311.2.1.21");
long _hResult = objReq.Submit(CR_IN_BASE64 | CR_IN_PKCS10,strPKCS10,"","DAISY\\AltaCA");