ssl_cert_request_info.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. #ifndef NET_SSL_SSL_CERT_REQUEST_INFO_H_
  5. #define NET_SSL_SSL_CERT_REQUEST_INFO_H_
  6. #include <string>
  7. #include <vector>
  8. #include "base/memory/ref_counted.h"
  9. #include "net/base/host_port_pair.h"
  10. #include "net/base/net_export.h"
  11. #include "net/ssl/ssl_client_cert_type.h"
  12. namespace net {
  13. // The SSLCertRequestInfo class represents server criteria regarding client
  14. // certificate required for a secure connection.
  15. //
  16. // In TLS 1.1, the CertificateRequest
  17. // message is defined as:
  18. // enum {
  19. // rsa_sign(1), dss_sign(2), rsa_fixed_dh(3), dss_fixed_dh(4),
  20. // rsa_ephemeral_dh_RESERVED(5), dss_ephemeral_dh_RESERVED(6),
  21. // fortezza_dms_RESERVED(20), (255)
  22. // } ClientCertificateType;
  23. //
  24. // opaque DistinguishedName<1..2^16-1>;
  25. //
  26. // struct {
  27. // ClientCertificateType certificate_types<1..2^8-1>;
  28. // DistinguishedName certificate_authorities<0..2^16-1>;
  29. // } CertificateRequest;
  30. class NET_EXPORT SSLCertRequestInfo
  31. : public base::RefCountedThreadSafe<SSLCertRequestInfo> {
  32. public:
  33. SSLCertRequestInfo();
  34. void Reset();
  35. // The host and port of the SSL server that requested client authentication.
  36. HostPortPair host_and_port;
  37. // True if the server that issues this request was the HTTPS proxy used in
  38. // the request. False, if the server was the origin server.
  39. bool is_proxy = false;
  40. // List of DER-encoded X.509 DistinguishedName of certificate authorities
  41. // allowed by the server.
  42. std::vector<std::string> cert_authorities;
  43. std::vector<SSLClientCertType> cert_key_types;
  44. private:
  45. friend class base::RefCountedThreadSafe<SSLCertRequestInfo>;
  46. ~SSLCertRequestInfo();
  47. };
  48. } // namespace net
  49. #endif // NET_SSL_SSL_CERT_REQUEST_INFO_H_