This documentation is archived and is not being maintained.

IssuedTokenServiceCredential.CertificateValidationMode Property

Gets or sets the certificate validation mode.

Namespace: System.ServiceModel.Security
Assembly: System.ServiceModel (in system.servicemodel.dll)

public X509CertificateValidationMode CertificateValidationMode { get; set; }
/** @property */
public X509CertificateValidationMode get_CertificateValidationMode ()

/** @property */
public void set_CertificateValidationMode (X509CertificateValidationMode value)

public function get CertificateValidationMode () : X509CertificateValidationMode

public function set CertificateValidationMode (value : X509CertificateValidationMode)

Not applicable.

Property Value

A X509CertificateValidationMode enumeration entry that specifies how the certificate is to be validated.

The following code shows one way to access and set this property.

// This method configures the IssuedTokenAuthentication property of a ServiceHost.
public static void ConfigureIssuedTokenServiceCredentials( 
    ServiceHost sh, bool allowCardspaceTokens, IList<X509Certificate2> knownissuers, 
    X509CertificateValidationMode certMode, X509RevocationMode revocationMode, SamlSerializer ser )
  // Allow CardSpace tokens.
  sh.Credentials.IssuedTokenAuthentication.AllowUntrustedRsaIssuers = allowCardspaceTokens;
  // Set up known issuer certificates.
  foreach(X509Certificate2 cert in knownissuers)
    sh.Credentials.IssuedTokenAuthentication.KnownCertificates.Add ( cert );

  // Set issuer certificate validation and revocation checking modes.
  sh.Credentials.IssuedTokenAuthentication.CertificateValidationMode = 
  sh.Credentials.IssuedTokenAuthentication.RevocationMode = X509RevocationMode.Online;
  sh.Credentials.IssuedTokenAuthentication.TrustedStoreLocation = StoreLocation.LocalMachine;

  // Set the SamlSerializer, if one is specified.
  if ( ser != null )
    sh.Credentials.IssuedTokenAuthentication.SamlSerializer = ser;

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0