1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef NET_BASE_SSL_CERT_REQUEST_INFO_H_ 6 #define NET_BASE_SSL_CERT_REQUEST_INFO_H_ 7 #pragma once 8 9 #include <string> 10 #include <vector> 11 12 #include "base/memory/ref_counted.h" 13 14 namespace net { 15 16 class X509Certificate; 17 18 // The SSLCertRequestInfo class contains the info that allows a user to 19 // select a certificate to send to the SSL server for client authentication. 20 class SSLCertRequestInfo 21 : public base::RefCountedThreadSafe<SSLCertRequestInfo> { 22 public: 23 SSLCertRequestInfo(); 24 25 void Reset(); 26 27 // The host and port of the SSL server that requested client authentication. 28 std::string host_and_port; 29 30 // A list of client certificates that match the server's criteria in the 31 // SSL CertificateRequest message. In TLS 1.0, the CertificateRequest 32 // message is defined as: 33 // enum { 34 // rsa_sign(1), dss_sign(2), rsa_fixed_dh(3), dss_fixed_dh(4), 35 // (255) 36 // } ClientCertificateType; 37 // 38 // opaque DistinguishedName<1..2^16-1>; 39 // 40 // struct { 41 // ClientCertificateType certificate_types<1..2^8-1>; 42 // DistinguishedName certificate_authorities<3..2^16-1>; 43 // } CertificateRequest; 44 std::vector<scoped_refptr<X509Certificate> > client_certs; 45 46 private: 47 friend class base::RefCountedThreadSafe<SSLCertRequestInfo>; 48 49 ~SSLCertRequestInfo(); 50 }; 51 52 } // namespace net 53 54 #endif // NET_BASE_SSL_CERT_REQUEST_INFO_H_ 55