X509ClientCertificateAuthentication.TrustedStoreLocation Eigenschap
Definitie
Belangrijk
Bepaalde informatie heeft betrekking op een voorlopige productversie die aanzienlijk kan worden gewijzigd voordat deze wordt uitgebracht. Microsoft biedt geen enkele expliciete of impliciete garanties met betrekking tot de informatie die hier wordt verstrekt.
Hiermee wordt de vertrouwde archieflocatie opgehaald of ingesteld waaronder de context van de clientcertificaatketen wordt gevalideerd.
public:
property System::Security::Cryptography::X509Certificates::StoreLocation TrustedStoreLocation { System::Security::Cryptography::X509Certificates::StoreLocation get(); void set(System::Security::Cryptography::X509Certificates::StoreLocation value); };
public System.Security.Cryptography.X509Certificates.StoreLocation TrustedStoreLocation { get; set; }
member this.TrustedStoreLocation : System.Security.Cryptography.X509Certificates.StoreLocation with get, set
Public Property TrustedStoreLocation As StoreLocation
Waarde van eigenschap
De vertrouwde opslaglocatie waaronder de context van de clientcertificaatketen wordt gevalideerd.
Uitzonderingen
set wanneer de referentie het kenmerk Alleen-lezen heeft.
Voorbeelden
// Create a service host.
Uri httpUri = new Uri("http://localhost/Calculator");
ServiceHost sh = new ServiceHost(typeof(Calculator), httpUri);
// Create a binding that uses a certificate.
WSHttpBinding b = new WSHttpBinding(SecurityMode.Message);
b.Security.Message.ClientCredentialType =
MessageCredentialType.Certificate;
// Get a reference to the authentication object.
X509ClientCertificateAuthentication myAuthProperties =
sh.Credentials.ClientCertificate.Authentication;
// Configure peer trust.
myAuthProperties.CertificateValidationMode =
X509CertificateValidationMode.PeerTrust;
myAuthProperties.TrustedStoreLocation =
StoreLocation.LocalMachine;
' Create a service host.
Dim httpUri As New Uri("http://localhost/Calculator")
Dim sh As New ServiceHost(GetType(Calculator), httpUri)
' Create a binding that uses a certificate.
Dim b As New WSHttpBinding(SecurityMode.Message)
b.Security.Message.ClientCredentialType = _
MessageCredentialType.Certificate
' Get a reference to the authentication object.
Dim myAuthProperties As X509ClientCertificateAuthentication = _
sh.Credentials.ClientCertificate.Authentication
' Configure peer trust.
myAuthProperties.CertificateValidationMode = _
X509CertificateValidationMode.PeerTrust
myAuthProperties.TrustedStoreLocation = StoreLocation.LocalMachine
De eigenschap kan ook worden ingesteld in een configuratiebestand.
<serviceCredentials>
<clientCertificate>
<authentication certificateValidationMode='ChainTrust' trustedStoreLocation = 'LocalMachine'/>
</clientCertificate>
</serviceCredentials>
Opmerkingen
Deze eigenschap geeft aan of de machine- of gebruikerscontext wordt gebruikt om de X.509-certificaatketen te verifiëren.