X509ClientCertificateAuthentication.CustomCertificateValidator Özellik
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
Özel bir istemci sertifikası doğrulayıcı alır veya ayarlar.
public:
property System::IdentityModel::Selectors::X509CertificateValidator ^ CustomCertificateValidator { System::IdentityModel::Selectors::X509CertificateValidator ^ get(); void set(System::IdentityModel::Selectors::X509CertificateValidator ^ value); };
public System.IdentityModel.Selectors.X509CertificateValidator CustomCertificateValidator { get; set; }
member this.CustomCertificateValidator : System.IdentityModel.Selectors.X509CertificateValidator with get, set
Public Property CustomCertificateValidator As X509CertificateValidator
Özellik Değeri
Özel istemci sertifikası doğrulayıcısı.
Özel durumlar
set kimlik bilgisi salt okunur olduğunda.
Örnekler
Aşağıdaki kodda bu özelliğin nasıl ayarlanacağı gösterilmektedir.
// Create a service host.
Uri httpUri = new Uri("http://localhost/Calculator");
ServiceHost sh = new ServiceHost(typeof(Calculator), httpUri);
// Get a reference to the authentication object.
X509ClientCertificateAuthentication myAuthProperties =
sh.Credentials.ClientCertificate.Authentication;
// Configure custom certificate validation.
myAuthProperties.CertificateValidationMode =
X509CertificateValidationMode.Custom;
// Specify a custom certificate validator (not shown here) that inherits
// from the X509CertificateValidator class.
// creds.ClientCertificate.Authentication.CustomCertificateValidator =
// new MyCertificateValidator();
' Create a service host.
Dim httpUri As New Uri("http://localhost/Calculator")
Dim sh As New ServiceHost(GetType(Calculator), httpUri)
' Get a reference to the authentication object.
Dim myAuthProperties As X509ClientCertificateAuthentication = _
sh.Credentials.ClientCertificate.Authentication
' Configure custom certificate validation.
myAuthProperties.CertificateValidationMode = X509CertificateValidationMode.Custom
' Specify a custom certificate validator (not shown here) that inherits
' from the X509CertificateValidator class.
' creds.ClientCertificate.Authentication.CustomCertificateValidator = _
' new MyCertificateValidator()
Özelliği bir yapılandırma dosyasında da ayarlanabilir.
<serviceCredentials>
<clientCertificate>
<authentication certificateValidationMode='Custom' customCertificateValidatorType='Samples.MyCertificateValidator, Samples' />
</clientCertificate>
</serviceCredentials>
Açıklamalar
CertificateValidationMode özelliği olarak Customayarlanırsa, özelliğini sınıfından CustomCertificateValidator devralan X509CertificateValidator bir özel doğrulayıcıya ayarlamanız gerekir.
Daha fazla bilgi için bkz . Nasıl yapılır: Özel Sertifika Doğrulayıcı Kullanan Bir Hizmet Oluşturma.