Export (0) Print
Expand All
Expand Minimize

X509CertificateValidationMode Enumeration

An enumeration that lists the ways of validating a certificate.

Namespace:  System.ServiceModel.Security
Assembly:  System.IdentityModel (in System.IdentityModel.dll)

'Declaration
Public Enumeration X509CertificateValidationMode

Member nameDescription
ChainTrustThe certificate is valid 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.
NoneNo validation of the certificate is done.
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.
PeerTrustThe certificate is valid if it is in the trusted people store.

          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;

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft