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 #include "net/base/net_export.h" 14 15 namespace net { 16 17 class X509Certificate; 18 19 // The SSLCertRequestInfo class contains the info that allows a user to 20 // select a certificate to send to the SSL server for client authentication. 21 class NET_EXPORT SSLCertRequestInfo 22 : public base::RefCountedThreadSafe<SSLCertRequestInfo> { 23 public: 24 SSLCertRequestInfo(); 25 26 void Reset(); 27 28 // The host and port of the SSL server that requested client authentication. 29 std::string host_and_port; 30 31 // A list of client certificates that match the server's criteria in the 32 // SSL CertificateRequest message. In TLS 1.0, the CertificateRequest 33 // message is defined as: 34 // enum { 35 // rsa_sign(1), dss_sign(2), rsa_fixed_dh(3), dss_fixed_dh(4), 36 // (255) 37 // } ClientCertificateType; 38 // 39 // opaque DistinguishedName<1..2^16-1>; 40 // 41 // struct { 42 // ClientCertificateType certificate_types<1..2^8-1>; 43 // DistinguishedName certificate_authorities<3..2^16-1>; 44 // } CertificateRequest; 45 std::vector<scoped_refptr<X509Certificate> > client_certs; 46 47 private: 48 friend class base::RefCountedThreadSafe<SSLCertRequestInfo>; 49 50 ~SSLCertRequestInfo(); 51 }; 52 53 } // namespace net 54 55 #endif // NET_BASE_SSL_CERT_REQUEST_INFO_H_ 56