HttpListenerRequest.GetClientCertificateAsync Method

Definition

Retrieves the client's X.509 v.3 certificate as an asynchronous operation.

public:
 System::Threading::Tasks::Task<System::Security::Cryptography::X509Certificates::X509Certificate2 ^> ^ GetClientCertificateAsync();
public System.Threading.Tasks.Task<System.Security.Cryptography.X509Certificates.X509Certificate2?> GetClientCertificateAsync ();
public System.Threading.Tasks.Task<System.Security.Cryptography.X509Certificates.X509Certificate2> GetClientCertificateAsync ();
member this.GetClientCertificateAsync : unit -> System.Threading.Tasks.Task<System.Security.Cryptography.X509Certificates.X509Certificate2>
Public Function GetClientCertificateAsync () As Task(Of X509Certificate2)

Returns

The task object representing the asynchronous operation. The Result property on the task object returns a System.Security.Cryptography.X509Certificates object that contains the client's X.509 v.3 certificate.

Remarks

This operation will not block. The returned Task<TResult> object will complete when the certificate has been retrieved.

If a call to this method to retrieve the client's X.509 v.3 certificate is in progress, then another call to this method cannot be made.

This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as ArgumentException, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by GetClientCertificate().

Applies to

See also