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)

'Declaration
Public ReadOnly Property ClientCertificate As HttpClientCertificate
'Usage
Dim instance As HttpRequest
Dim value As HttpClientCertificate

value = instance.ClientCertificate

/** @property */
public HttpClientCertificate get_ClientCertificate ()

public function get ClientCertificate () : HttpClientCertificate

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.

Dim cs As 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>")


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 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft