HttpWebClientProtocol.ClientCertificates Propiedad

Definición

Obtiene la colección de certificados del cliente.

public:
 property System::Security::Cryptography::X509Certificates::X509CertificateCollection ^ ClientCertificates { System::Security::Cryptography::X509Certificates::X509CertificateCollection ^ get(); };
[System.ComponentModel.Browsable(false)]
public System.Security.Cryptography.X509Certificates.X509CertificateCollection ClientCertificates { get; }
[<System.ComponentModel.Browsable(false)>]
member this.ClientCertificates : System.Security.Cryptography.X509Certificates.X509CertificateCollection
Public ReadOnly Property ClientCertificates As X509CertificateCollection

Valor de propiedad

X509CertificateCollection que representa los certificados del cliente.

Atributos

Ejemplos

En el ejemplo de código siguiente se muestra cómo cargar en un certificado de cliente desde un archivo y, a continuación, agregarlo a la ClientCertificates propiedad para llamar a un método de servicio web XML que usa certificados de cliente para la autenticación.

// Create a new instance of a proxy class for the Bank XML Web service.
BankSession bank = new BankSession();

// Load the client certificate from a file.
X509Certificate x509 = X509Certificate.CreateFromCertFile(@"c:\user.cer");

// Add the client certificate to the ClientCertificates property of the proxy class.
bank.ClientCertificates.Add(x509);

// Communicate with the Deposit XML Web service method,
// which requires authentication using client certificates.
bank.Deposit(500);
' Create a new instance of a proxy class for the Bank XML Web service.
Dim bank As BankSession = new BankSession()

' Load the client certificate from a file.
Dim x509 As X509Certificate = X509Certificate.CreateFromCertFile("c:\user.cer")

' Add the client certificate to the ClientCertificates property of the proxy class.
bank.ClientCertificates.Add(x509)

' Communicate with the Deposit XML Web service method,
' which requires authentication using client certificates.
bank.Deposit(500)

Comentarios

Esta propiedad permite a un cliente pasar uno o varios certificados de cliente, también conocidos como certificados Authenticode X.509 v.3, al llamar a un método de servicio web XML. Si el método de servicio web XML se ha configurado para usar certificados de cliente, se puede usar un certificado de cliente como un mecanismo para autenticar un cliente. Para más información sobre cómo configurar certificados de cliente, consulte la documentación de Internet Information Services (IIS).

Se aplica a

Consulte también