Export (0) Print
Expand All

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 Value

Type: System.ServiceModel.Security.X509CertificateValidationMode
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 = 
          X509CertificateValidationMode.PeerOrChainTrust;
      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 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

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

Community Additions

ADD
Show:
© 2014 Microsoft