X509ClientCertificateAuthentication Klass
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Anger autentiseringsegenskaper för validering av klientcertifikatet.
public ref class X509ClientCertificateAuthentication
public class X509ClientCertificateAuthentication
type X509ClientCertificateAuthentication = class
Public Class X509ClientCertificateAuthentication
- Arv
-
X509ClientCertificateAuthentication
Exempel
Följande kod visar hur du anger den här egenskapen.
// 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 peer trust.
myAuthProperties.CertificateValidationMode =
X509CertificateValidationMode.PeerTrust;
// Configure chain trust.
myAuthProperties.CertificateValidationMode =
X509CertificateValidationMode.ChainTrust;
// 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 peer trust.
myAuthProperties.CertificateValidationMode = X509CertificateValidationMode.PeerTrust
' Configure chain trust.
myAuthProperties.CertificateValidationMode = X509CertificateValidationMode.ChainTrust
' 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()
Egenskapen kan också anges i en konfigurationsfil.
<serviceCredentials>
<clientCertificate>
<authentication certificateValidationMode='ChainTrust' />
</clientCertificate>
</serviceCredentials>
Kommentarer
CertificateValidationMode Om är inställt på Custommåste du skapa en anpassad certifikatverifierare som ärver från X509CertificateValidator klassen. Mer information finns i Så här skapar du en tjänst som använder en anpassad certifikatverifierare.
Egenskaper
| Name | Description |
|---|---|
| CertificateValidationMode |
Hämtar eller anger certifikatverifieringsläget. |
| CustomCertificateValidator |
Hämtar eller anger en anpassad klientcertifikatverifierare. |
| IncludeWindowsGroups |
Hämtar eller anger ett värde som anger om Windows grupper ingår i auktoriseringskontexten. |
| MapClientCertificateToWindowsAccount |
Hämtar eller anger ett värde som anger om certifikatet är mappat till Windows konton. |
| RevocationMode |
Hämtar eller anger läget för återkallande av certifikat för ChainTrust- och PeerOrChainTrust X.509-certifikatverifiering. |
| TrustedStoreLocation |
Hämtar eller anger den betrodda lagringsplatsen under vilken kontext klientcertifikatkedjan verifieras. |
Metoder
| Name | Description |
|---|---|
| Equals(Object) |
Avgör om det angivna objektet är lika med det aktuella objektet. (Ärvd från Object) |
| GetHashCode() |
Fungerar som standard-hash-funktion. (Ärvd från Object) |
| GetType() |
Hämtar den aktuella instansen Type . (Ärvd från Object) |
| MemberwiseClone() |
Skapar en ytlig kopia av den aktuella Object. (Ärvd från Object) |
| ToString() |
Returnerar en sträng som representerar det aktuella objektet. (Ärvd från Object) |