Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
 X509CertificateValidationMode Enume...
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
X509CertificateValidationMode Enumeration

An enumeration that lists the ways of validating a certificate.

Namespace:  System.ServiceModel.Security
Assembly:  System.ServiceModel (in System.ServiceModel.dll)
Visual Basic (Declaration)
Public Enumeration X509CertificateValidationMode
Visual Basic (Usage)
Dim instance As X509CertificateValidationMode
C#
public enum X509CertificateValidationMode
Visual C++
public enum class X509CertificateValidationMode
JScript
public enum X509CertificateValidationMode
Member nameDescription
Supported by the .NET Compact FrameworkNoneNo validation of the certificate is done.
PeerTrustThe certificate is valid if it is in the trusted people store.
Supported by the .NET Compact FrameworkChainTrustThe certificate is valid if the chain builds to a certification authority in the trusted root store.
PeerOrChainTrustThe certificate is valid if it is in the trusted people store, or if the chain builds to a certification authority in the trusted root store.
CustomThe user must plug in a custom X509CertificateValidator to validate the certificate.
C#
          ChannelFactory<ISimpleChannel> cf =
              new ChannelFactory<ISimpleChannel>();
          cf.Credentials.ClientCertificate.SetCertificate(
              StoreLocation.CurrentUser, StoreName.My,
              X509FindType.FindByThumbprint,
"37 28 05 09 22 81 07 08 a0 cd 2a af dd c3 83 cd c3 3b 8f 9d");
          cf.Credentials.ServiceCertificate.SetDefaultCertificate(
              StoreLocation.CurrentUser,
              StoreName.TrustedPeople,
              X509FindType.FindByThumbprint,
"33 93 68 cc 7c 75 80 24 a2 80 9f 45 8c 81 fa 92 ad 5b 04 39");
          cf.Credentials.ServiceCertificate.Authentication.CertificateValidationMode
              = X509CertificateValidationMode.PeerOrChainTrust;

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC

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.

.NET Framework

Supported in: 3.5, 3.0

.NET Compact Framework

Supported in: 3.5
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker