ClientCredentials.ClientCertificate Propriété

Définition

Obtient un objet que vous pouvez utiliser pour fournir le certificat X.509 permettant au client de s'authentifier auprès du service.Gets an object that you can use to provide the X.509 certificate that the client uses to authenticate to the service.

public:
 property System::ServiceModel::Security::X509CertificateInitiatorClientCredential ^ ClientCertificate { System::ServiceModel::Security::X509CertificateInitiatorClientCredential ^ get(); };
public System.ServiceModel.Security.X509CertificateInitiatorClientCredential ClientCertificate { get; }
member this.ClientCertificate : System.ServiceModel.Security.X509CertificateInitiatorClientCredential
Public ReadOnly Property ClientCertificate As X509CertificateInitiatorClientCredential

Valeur de propriété

X509CertificateInitiatorClientCredential qui représente le certificat client.An X509CertificateInitiatorClientCredential that represents the client certificate.

Exemples

Le code suivant indique comment configurer le certificat X.509 à l'aide de cette propriété.The following code shows how you can use this property to configure the X.509 certificate.

// Create the client with the binding and EndpointAddress.
CalculatorClient calcClient = new CalculatorClient(b, ea);

// Set the client credential value to a valid certificate.
calcClient.ClientCredentials.ClientCertificate.SetCertificate(
    StoreLocation.CurrentUser, 
    StoreName.TrustedPeople, 
    X509FindType.FindBySubjectName, 
    "client.com");
' Create the client with the binding and EndpointAddress.
Dim calcClient As New CalculatorClient(b, ea)

' Set the client credential value to a valid certificate.
calcClient.ClientCredentials.ClientCertificate.SetCertificate(StoreLocation.CurrentUser, StoreName.TrustedPeople, X509FindType.FindBySubjectName, "client.com")

Remarques

Vous pouvez également définir cette valeur à l’aide du certificat de<> dans un fichier de configuration d’application cliente.You can also set this value using the <certificate> in a client application configuration file.

S’applique à