IssuedTokenServiceCredential.CertificateValidationMode Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets or sets the certificate validation mode.

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

Public Property CertificateValidationMode As X509CertificateValidationMode

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 Shared Sub ConfigureIssuedTokenServiceCredentials( _
    ByVal sh As ServiceHost, _
    ByVal allowCardspaceTokens As Boolean, _
    ByVal knownissuers As IList(Of X509Certificate2), _
    ByVal certMode As X509CertificateValidationMode, _
    ByVal revocationMode As X509RevocationMode, _
    ByVal ser As SamlSerializer _
    ' Allow CardSpace tokens.
    sh.Credentials.IssuedTokenAuthentication.AllowUntrustedRsaIssuers = _

    ' Set up known issuer certificates.
    Dim cert As X509Certificate2
    For Each cert In knownissuers
    Next cert
    ' Set issuer certificate validation and revocation checking modes.
    sh.Credentials.IssuedTokenAuthentication.CertificateValidationMode = _
    sh.Credentials.IssuedTokenAuthentication.RevocationMode = _

    ' Set the SamlSerializer, if one is specified.
    If Not (ser Is Nothing) Then
        sh.Credentials.IssuedTokenAuthentication.SamlSerializer = ser
    End If
End Sub

.NET Framework
Available since 3.0
Return to top