| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROMEOS_NETWORK_CERTIFICATE_PATTERN_H_ | 5 #ifndef CHROMEOS_NETWORK_CERTIFICATE_PATTERN_H_ |
| 6 #define CHROMEOS_NETWORK_CERTIFICATE_PATTERN_H_ | 6 #define CHROMEOS_NETWORK_CERTIFICATE_PATTERN_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 const std::string& organization, | 27 const std::string& organization, |
| 28 const std::string& organizational_unit); | 28 const std::string& organizational_unit); |
| 29 ~IssuerSubjectPattern(); | 29 ~IssuerSubjectPattern(); |
| 30 | 30 |
| 31 // Returns true if all fields in the pattern are empty. | 31 // Returns true if all fields in the pattern are empty. |
| 32 bool Empty() const; | 32 bool Empty() const; |
| 33 | 33 |
| 34 // Clears out all values in this pattern. | 34 // Clears out all values in this pattern. |
| 35 void Clear(); | 35 void Clear(); |
| 36 | 36 |
| 37 void set_common_name(const std::string& name) { common_name_ = name; } | |
| 38 void set_locality(const std::string& locality) { locality_ = locality; } | |
| 39 void set_organization(const std::string& organization) { | |
| 40 organization_ = organization; | |
| 41 } | |
| 42 void set_organizational_unit(const std::string& unit) { | |
| 43 organizational_unit_ = unit; | |
| 44 } | |
| 45 | |
| 46 const std::string& common_name() const { | 37 const std::string& common_name() const { |
| 47 return common_name_; | 38 return common_name_; |
| 48 } | 39 } |
| 49 const std::string& locality() const { | 40 const std::string& locality() const { |
| 50 return locality_; | 41 return locality_; |
| 51 } | 42 } |
| 52 const std::string& organization() const { | 43 const std::string& organization() const { |
| 53 return organization_; | 44 return organization_; |
| 54 } | 45 } |
| 55 const std::string& organizational_unit() const { | 46 const std::string& organizational_unit() const { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 71 // pattern in the certificate database. | 62 // pattern in the certificate database. |
| 72 class CHROMEOS_EXPORT CertificatePattern { | 63 class CHROMEOS_EXPORT CertificatePattern { |
| 73 public: | 64 public: |
| 74 CertificatePattern(); | 65 CertificatePattern(); |
| 75 ~CertificatePattern(); | 66 ~CertificatePattern(); |
| 76 | 67 |
| 77 // Returns true if this pattern has nothing set (and so would match | 68 // Returns true if this pattern has nothing set (and so would match |
| 78 // all certs). Ignores enrollment_uri_; | 69 // all certs). Ignores enrollment_uri_; |
| 79 bool Empty() const; | 70 bool Empty() const; |
| 80 | 71 |
| 81 void set_issuer(const IssuerSubjectPattern& issuer) { issuer_ = issuer; } | |
| 82 void set_subject(const IssuerSubjectPattern& subject) { subject_ = subject; } | |
| 83 void set_enrollment_uri_list(const std::vector<std::string>& uri_list) { | |
| 84 enrollment_uri_list_ = uri_list; | |
| 85 } | |
| 86 | |
| 87 const IssuerSubjectPattern& issuer() const { | 72 const IssuerSubjectPattern& issuer() const { |
| 88 return issuer_; | 73 return issuer_; |
| 89 } | 74 } |
| 90 const IssuerSubjectPattern& subject() const { | 75 const IssuerSubjectPattern& subject() const { |
| 91 return subject_; | 76 return subject_; |
| 92 } | 77 } |
| 93 const std::vector<std::string>& issuer_ca_pems() const { | 78 const std::vector<std::string>& issuer_ca_pems() const { |
| 94 return issuer_ca_pems_; | 79 return issuer_ca_pems_; |
| 95 } | 80 } |
| 96 const std::vector<std::string>& enrollment_uri_list() const { | 81 const std::vector<std::string>& enrollment_uri_list() const { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 108 | 93 |
| 109 std::vector<std::string> issuer_ca_pems_; | 94 std::vector<std::string> issuer_ca_pems_; |
| 110 IssuerSubjectPattern issuer_; | 95 IssuerSubjectPattern issuer_; |
| 111 IssuerSubjectPattern subject_; | 96 IssuerSubjectPattern subject_; |
| 112 std::vector<std::string> enrollment_uri_list_; | 97 std::vector<std::string> enrollment_uri_list_; |
| 113 }; | 98 }; |
| 114 | 99 |
| 115 } // namespace chromeos | 100 } // namespace chromeos |
| 116 | 101 |
| 117 #endif // CHROMEOS_NETWORK_CERTIFICATE_PATTERN_H_ | 102 #endif // CHROMEOS_NETWORK_CERTIFICATE_PATTERN_H_ |
| OLD | NEW |