Udostępnij za pośrednictwem


X509ServiceCertificateAuthentication.TrustedStoreLocation Właściwość

Definicja

Pobiera lub ustawia zaufaną lokalizację magazynu, w ramach której jest weryfikowany kontekst łańcucha certyfikatów 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

Wartość właściwości

StoreLocation

Zaufana lokalizacja magazynu.

Wyjątki

Podjęto próbę ustawienia, gdy poświadczenia są tylko do odczytu.

Przykłady

Poniższy kod pokazuje, jak ustawić tę właściwość.

ClientCredentials creds = new ClientCredentials();

// Configure chain trust.
creds.ServiceCertificate.Authentication.CertificateValidationMode
    = X509CertificateValidationMode.ChainTrust;
creds.ServiceCertificate.Authentication.TrustedStoreLocation
    = StoreLocation.LocalMachine;
Dim creds As New ClientCredentials()

' Configure chain trust.
creds.ServiceCertificate.Authentication.CertificateValidationMode = X509CertificateValidationMode.ChainTrust
creds.ServiceCertificate.Authentication.TrustedStoreLocation = StoreLocation.LocalMachine

Właściwość można również ustawić w pliku konfiguracji.

Uwagi

Ta właściwość określa, czy kontekst komputera lub użytkownika będzie używany do weryfikowania łańcucha certyfikatów X.509.

Dotyczy