RemoteCertificateValidationCallback Delegate Home
This page is specific to:.NET Framework Version:2.03.03.54.0
.NET Framework Class Library
RemoteCertificateValidationCallback Delegate

Verifies the remote Secure Sockets Layer (SSL) certificate used for authentication.

Namespace:  System.Net.Security
Assembly:  System (in System.dll)
Syntax

'Usage

Dim instance As New RemoteCertificateValidationCallback(AddressOf HandlerMethod)

'Declaration

Public Delegate Function RemoteCertificateValidationCallback ( _
    sender As Object, _
    certificate As X509Certificate, _
    chain As X509Chain, _
    sslPolicyErrors As SslPolicyErrors _
) As Boolean

Parameters

sender
Type: System..::.Object
An object that contains state information for this validation.
certificate
Type: System.Security.Cryptography.X509Certificates..::.X509Certificate
The certificate used to authenticate the remote party.
chain
Type: System.Security.Cryptography.X509Certificates..::.X509Chain
The chain of certificate authorities associated with the remote certificate.
sslPolicyErrors
Type: System.Net.Security..::.SslPolicyErrors
One or more errors associated with the remote certificate.

Return Value

Type: System..::.Boolean
A Boolean value that determines whether the specified certificate is accepted for authentication.
Remarks

The delegate's sslPolicyErrors argument contains any certificate errors returned by SSPI while authenticating the client or server. The Boolean value returned by the method invoked by this delegate determines whether the authentication is allowed to succeed.

This delegate is used with the SslStream class.

Examples

The following code example implements a method that is invoked by an instance of the RemoteCertificateValidationCallback class. If there are validation errors, this method displays them and returns false, which prevents communication with the unauthenticated server.

We do not yet have a code sample for this language.

The following code example creates the delegate using the method defined in the preceding code example.

We do not yet have a code sample for this language.
Platforms

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information

.NET Framework

Supported in: 3.5, 3.0, 2.0
See Also

Reference

© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View