Re: How to get client certificate from IIS?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Karel Miklav (karel_at_inetis.spppambait.com)
Date: 01/17/05


Date: Mon, 17 Jan 2005 07:47:32 +0100

Egbert Nierop (MVP for IIS) wrote:
> Did you set IIS as shown in picture?
> If you don't it won't give you certificates.

Yes, thanks Egbert, I get the certificate. It's just that in
ASP/VBScript I can't decode it properly from binary form and in
ASP/JScript I don't know what to do with the received object at all. I
have no problems in .NET/C#, but I'd prefer to have one simple file for
that as the rest of the application is CGI. Or be able to load the
certificate from CGI, if that's possible.

Here's a snip of my working C# piece:

private void Page_Load(object sender, System.EventArgs e)
{
     byte[] content = Request.ClientCertificate.Certificate;
     string certificate =
         "-----BEGIN CERTIFICATE-----<br/>" +
         wrap(System.Convert.ToBase64String(content), 64) + "<br/>" +
         "-----END CERTIFICATE-----<br/>";

     Response.Write(certificate);
}

--
Regards,
Karel Miklav


Relevant Pages

  • Re: How to get client certificate from IIS?
    ... > Egbert Nierop wrote: ... >> Did you set IIS as shown in picture? ... > Yes, thanks Egbert, I get the certificate. ... In ASP script you can't have binary arrays, only if you use external COM ...
    (microsoft.public.inetserver.iis)
  • Request.ClientCertificate()
    ... I use https so I set IIS to require a certificate every ... smart cards) will have access to the web application. ... can I find this database and how can I interrogate it? ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • How to connect to a web service using certificates
    ... Apache on a nix server. ... The web service is protected by a certificate. ... How do register the certificate with the nix based cgi? ...
    (comp.unix.programmer)