HttpRequest.ClientCertificate Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the current request's client security certificate.
public:
property System::Web::HttpClientCertificate ^ ClientCertificate { System::Web::HttpClientCertificate ^ get(); };
public System.Web.HttpClientCertificate ClientCertificate { get; }
member this.ClientCertificate : System.Web.HttpClientCertificate
Public ReadOnly Property ClientCertificate As HttpClientCertificate
Property Value
An HttpClientCertificate object containing information about the client's security certificate settings.
Examples
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>");
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>")
Applies to
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET