Share via


X509ClientCertificateAuthentication.TrustedStoreLocation Vlastnost

Definice

Získá nebo nastaví umístění důvěryhodného úložiště, ve kterém kontextu je ověřen řetěz certifikátů klienta.

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

Hodnota vlastnosti

Umístění důvěryhodného úložiště, ve kterém se ověřuje řetěz certifikátů klienta.

Výjimky

set pokud jsou přihlašovací údaje jen pro čtení.

Příklady

// 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

Vlastnost lze také nastavit v konfiguračním souboru.

<serviceCredentials>  
  <clientCertificate>  
     <authentication certificateValidationMode='ChainTrust'   trustedStoreLocation = 'LocalMachine'/>  
  </clientCertificate>  
</serviceCredentials>  

Poznámky

Tato vlastnost určuje, jestli se k ověření řetězu certifikátů X.509 použije kontext počítače nebo uživatele.

Platí pro