Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > Creating & Distibuting X509 Client Certificates

Reply
Thread Tools

Creating & Distibuting X509 Client Certificates

 
 
Pete
Guest
Posts: n/a
 
      12-08-2003
Hi,
As part of a commerce site I'd like to generate Client Browser
Certificates for users to install and give access to some protected
resources.

I'm guessing I can use the .NET X509Certificate class to create a user's
certificate, but how do I create the initial .cer request file?

Also if I create the cerificate on the server using the
X509Certificate.CreateFromCertFile will be all that is required for the
certifcate to become active?

thanks

Pete


 
Reply With Quote
 
 
 
 
Pete
Guest
Posts: n/a
 
      12-09-2003
Finally came up with

public string CreateClientCertificate(string a_sName, string a_sEmail,
string a_sCompany, string a_sDepartment, string a_sCity, string a_sState,
string a_sCountry, string a_sCA)

{

CERTCLIENTLib.CCertRequestClass cr = new CERTCLIENTLib.CCertRequestClass();

XENROLLLib.CEnrollClass ce = new XENROLLLib.CEnrollClass();


try

{

//Create the request

string strDN = "CN=" + a_sName;

strDN = strDN + ",O=" + a_sCompany;

strDN = strDN + ",OU=" + a_sDepartment;

strDN = strDN + ",L=" + a_sCity;

strDN = strDN + ",S=" + a_sState;

strDN = strDN + ",C=" + a_sCountry;

strDN = strDN + ",E=" + a_sEmail;


//Encode the request (1.3.6.1.4.1.311.2.1.21) represents a client-browser
certificate

strDN = ce.createPKCS10(strDN,"1.3.6.1.4.1.311.2.1.21");

//Submit the request to the CA

int iResult = cr.Submit(0x100 | 0x1 ,strDN,"",a_sCA);

//Get it back out again

string s = cr.GetCertificate(iResult);

return s;

}

catch(Exception e)

{

return "";

}

}





--
Cheers

Pete

XBOX Live Leagues & Tournaments
http://www.xboxracing.net/
"Pete" <pete denness a-t qsadotcodotuk> wrote in message
news:(E-Mail Removed)...
> Hi,
> As part of a commerce site I'd like to generate Client Browser
> Certificates for users to install and give access to some protected
> resources.
>
> I'm guessing I can use the .NET X509Certificate class to create a user's
> certificate, but how do I create the initial .cer request file?
>
> Also if I create the cerificate on the server using the
> X509Certificate.CreateFromCertFile will be all that is required for the
> certifcate to become active?
>
> thanks
>
> Pete
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
JavaScript and X509 Certificates .. help !! paxtra@gmail.com Javascript 0 08-17-2006 06:43 AM
Java and X509 Certificates .. help!! paxtra Java 0 08-17-2006 06:42 AM
Using X509 Certificates to access a Web Service from Windows Mobile? LosManos ASP .Net Security 2 01-28-2006 04:54 PM
Keyset does not exist at Microsoft.Web.Services.Security.X509.X509 Keyset does not exist X509Certificate ASP .Net Web Services 0 06-12-2004 01:07 AM
Self-issued certificates and commercial certificates. Lord Amoeba Computer Security 2 05-05-2004 01:40 PM



Advertisments