Skip to main content
.NET Framework Class Library
HttpListenerRequest..::.GetClientCertificate Method

Retrieves the client's X.509 v.3 certificate.

Namespace: System.Net
Assembly: System (in System.dll)
Syntax
Public Function GetClientCertificate As X509Certificate2
public X509Certificate2 GetClientCertificate()
public:
X509Certificate2^ GetClientCertificate()
member GetClientCertificate : unit -> X509Certificate2 

Return Value

Type: System.Security.Cryptography.X509Certificates..::.X509Certificate2
A System.Security.Cryptography.X509Certificates object that contains the client's X.509 v.3 certificate.
Exceptions
ExceptionCondition
InvalidOperationException

A call to this method to retrieve the client's X.509 v.3 certificate is in progress and therefore another call to this method cannot be made.

Remarks

This method blocks until the certificate is retrieved.

Version Information

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Platforms

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

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