HttpWebRequest.ClientCertificates Propriedade
Definição
Obtém ou define a coleção de certificados de segurança que estão associadas essa solicitação.Gets or sets the collection of security certificates that are associated with this request.
public:
property System::Security::Cryptography::X509Certificates::X509CertificateCollection ^ ClientCertificates { System::Security::Cryptography::X509Certificates::X509CertificateCollection ^ get(); void set(System::Security::Cryptography::X509Certificates::X509CertificateCollection ^ value); };
public:
property System::Security::Cryptography::X509Certificates::X509CertificateCollection ^ ClientCertificates { System::Security::Cryptography::X509Certificates::X509CertificateCollection ^ get(); };
public System.Security.Cryptography.X509Certificates.X509CertificateCollection ClientCertificates { get; set; }
public System.Security.Cryptography.X509Certificates.X509CertificateCollection ClientCertificates { get; }
member this.ClientCertificates : System.Security.Cryptography.X509Certificates.X509CertificateCollection with get, set
member this.ClientCertificates : System.Security.Cryptography.X509Certificates.X509CertificateCollection
Public Property ClientCertificates As X509CertificateCollection
Public ReadOnly Property ClientCertificates As X509CertificateCollection
Valor da propriedade
Um X509CertificateCollection que contém os certificados de segurança associados a essa solicitação.The X509CertificateCollection that contains the security certificates associated with this request.
Exceções
O valor especificado para uma operação de definição é null.The value specified for a set operation is null.
Comentários
Um aplicativo pode adicionar um certificado a uma coleção, mas pode não ter direitos de acesso a ele.An application can add a certificate to a collection, but might not have access rights to it. Para usar um certificado contido na coleção, o aplicativo deve ter os mesmos direitos de acesso que a entidade que emitiu o certificado.To use a certificate contained in the collection, the application must have the same access rights as the entity that issued the certificate.
Observação
A estrutura armazena em cache as sessões SSL conforme elas são criadas e tenta reutilizar uma sessão armazenada em cache para uma nova solicitação, se possível.The Framework caches SSL sessions as they are created and attempts to reuse a cached session for a new request, if possible. Ao tentar reutilizar uma sessão SSL, a estrutura usa o primeiro elemento de ClientCertificates (se houver) ou tenta reutilizar as sessões anônimas se o ClientCertificates estiver vazio.When attempting to reuse an SSL session, the Framework uses the first element of ClientCertificates (if there is one), or tries to reuse an anonymous sessions if ClientCertificates is empty.
Observação
Por motivos de desempenho, você não deve adicionar um certificado de cliente a HttpWebRequest , a menos que você saiba que o servidor o solicitará.For performance reasons, you shouldn't add a client certificate to a HttpWebRequest unless you know the server will ask for it.
Para obter um exemplo de código que ilustra como enumerar os certificados no repositório de certificados do cliente, consulte a X509Certificate2Collection classe.For a code example illustrating how to enumerate the certificates in the client certificate store, see the X509Certificate2Collection class.