Creating & Distibuting X509 Client Certificates

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default Creating & Distibuting X509 Client Certificates

    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


    Pete Guest

  2. Similar Questions and Discussions

    1. Using SSL Client Certificates
      I am using HTTPS with Apache and ColdFusion MX7. The Apache server is set up to require client certificates from a specific CA. I need to find out...
    2. Client Certificates
      Hi all. I'm implementing a Web Service and a Client that comunicate with SSL. The Client has a certificate that load with:...
    3. Unable to communicate with SSL Web Service using X509 Client Cert
      This is one of those cases where it works (calling the Web Service) in a WinForm app but not in ASP.Net. I am attempting to call a PayPal Web...
    4. ASP.NET and client certificates
      Hi People, I know in IIS Admin you can tick the box to request a client certificate (over an SSL connection), but does anyone know of a way,...
    5. x509 certificates
      Hi PHP folks, Does anybody know a way to read the extension fields from a x509 certificate? Maybe there is a better PHP module than openssl....
  3. #2

    Default Re: Creating & Distibuting X509 Client Certificates

    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
    [url]http://www.xboxracing.net/[/url]
    "Pete" <pete denness a-t qsadotcodotuk> wrote in message
    news:ent4SRYvDHA.2220@TK2MSFTNGP09.phx.gbl...
    > 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
    >
    >

    Pete Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139