Export (0) Print
Expand All

HttpRequest.ClientCertificate Property

Gets the current request's client security certificate.

Namespace: System.Web
Assembly: System.Web (in system.web.dll)

public HttpClientCertificate ClientCertificate { get; }
/** @property */
public HttpClientCertificate get_ClientCertificate ()

public function get ClientCertificate () : HttpClientCertificate

Not applicable.

Property Value

An HttpClientCertificate object containing information about the client's security certificate settings.

The following code example sends the client's certificate settings back to the client in an HTML page.

HttpClientCertificate cs = Request.ClientCertificate;
 
Response.Write("ClientCertificate Settings:<br>");
Response.Write("Certificate = " + cs.Certificate + "<br>");
Response.Write("Cookie = " + cs.Cookie + "<br>");
Response.Write("Flags = " + cs.Flags + "<br>");
Response.Write("IsPresent = " + cs.IsPresent + "<br>");
Response.Write("Issuer = " + cs.Issuer + "<br>");
Response.Write("IsValid = " + cs.IsValid + "<br>");
Response.Write("KeySize = " + cs.KeySize + "<br>");
Response.Write("SecretKeySize = " + cs.SecretKeySize + "<br>");
Response.Write("SerialNumber = " + cs.SerialNumber + "<br>");
Response.Write("ServerIssuer = " + cs.ServerIssuer + "<br>");
Response.Write("ServerSubject = " + cs.ServerSubject + "<br>");
Response.Write("Subject = " + cs.Subject + "<br>");
Response.Write("ValidFrom = " + cs.ValidFrom + "<br>");
Response.Write("ValidUntil = " + cs.ValidUntil + "<br>");
Response.Write("What's this = " + cs.ToString() + "<br>");
 

HttpClientCertificate cs = get_Request().get_ClientCertificate();

get_Response().Write("ClientCertificate Settings:<br>");
get_Response().Write(("Certificate = " + cs.get_Certificate()
    + "<br>"));
get_Response().Write(("Cookie = " + cs.get_Cookie() + "<br>"));
get_Response().Write(("Flags = " + cs.get_Flags() + "<br>"));
get_Response().Write(("IsPresent = " + cs.get_IsPresent() + "<br>"));
get_Response().Write(("Issuer = " + cs.get_Issuer() + "<br>"));
get_Response().Write(("IsValid = " + cs.get_IsValid() + "<br>"));
get_Response().Write(("KeySize = " + cs.get_KeySize() + "<br>"));
get_Response().Write(("SecretKeySize = " + cs.get_SecretKeySize()
    + "<br>"));
get_Response().Write(("SerialNumber = " + cs.get_SerialNumber()
    + "<br>"));
get_Response().Write(("ServerIssuer = " + cs.get_ServerIssuer()
    + "<br>"));
get_Response().Write(("ServerSubject = " + cs.get_ServerSubject()
    + "<br>"));
get_Response().Write(("Subject = " + cs.get_Subject() + "<br>"));
get_Response().Write(("ValidFrom = " + cs.get_ValidFrom() + "<br>"));
get_Response().Write(("ValidUntil = " + cs.get_ValidUntil() + "<br>"));
get_Response().Write(("What's this = " + cs.toString() + "<br>"));

var cs : HttpClientCertificate = Request.ClientCertificate

Response.Write("<p>Client Certificate settings:</p>")
Response.Write("Certificate = " + cs.Certificate.ToString() + "<br>")
Response.Write("Cookie = " + cs.Cookie + "<br>")
Response.Write("Flags = " + cs.Flags + "<br>")
Response.Write("IsPresent = " + cs.IsPresent + "<br>")
Response.Write("Issuer = " + cs.Issuer + "<br>")
Response.Write("IsValid = " + cs.IsValid + "<br>")
Response.Write("KeySize = " + cs.KeySize + "<br>")
Response.Write("SecretKeySize = " + cs.SecretKeySize + "<br>")
Response.Write("SerialNumber = " + cs.SerialNumber + "<br>")
Response.Write("ServerIssuer = " + cs.ServerIssuer + "<br>")
Response.Write("ServerSubject = " + cs.ServerSubject + "<br>")
Response.Write("Subject = " + cs.Subject + "<br>")
Response.Write("ValidFrom = " + cs.ValidFrom + "<br>")
Response.Write("ValidUntil = " + cs.ValidUntil + "<br>")
Response.Write("What//s this = " + cs.ToString() + "<br>")


Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft