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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 CertificatePattern(); | 75 CertificatePattern(); |
76 ~CertificatePattern(); | 76 ~CertificatePattern(); |
77 | 77 |
78 // Returns true if this pattern has nothing set (and so would match | 78 // Returns true if this pattern has nothing set (and so would match |
79 // all certs). Ignores enrollment_uri_; | 79 // all certs). Ignores enrollment_uri_; |
80 bool Empty() const; | 80 bool Empty() const; |
81 | 81 |
82 // Clears out all the values in this pattern (so Empty returns true). | 82 // Clears out all the values in this pattern (so Empty returns true). |
83 void Clear(); | 83 void Clear(); |
84 | 84 |
85 void set_issuer_ca_ref_list(const std::vector<std::string>& ref_list) { | |
86 issuer_ca_ref_list_ = ref_list; | |
87 } | |
88 void set_issuer(const IssuerSubjectPattern& issuer) { issuer_ = issuer; } | 85 void set_issuer(const IssuerSubjectPattern& issuer) { issuer_ = issuer; } |
89 void set_subject(const IssuerSubjectPattern& subject) { subject_ = subject; } | 86 void set_subject(const IssuerSubjectPattern& subject) { subject_ = subject; } |
90 void set_enrollment_uri_list(const std::vector<std::string>& uri_list) { | 87 void set_enrollment_uri_list(const std::vector<std::string>& uri_list) { |
91 enrollment_uri_list_ = uri_list; | 88 enrollment_uri_list_ = uri_list; |
92 } | 89 } |
93 | 90 |
94 const IssuerSubjectPattern& issuer() const { | 91 const IssuerSubjectPattern& issuer() const { |
95 return issuer_; | 92 return issuer_; |
96 } | 93 } |
97 const IssuerSubjectPattern& subject() const { | 94 const IssuerSubjectPattern& subject() const { |
98 return subject_; | 95 return subject_; |
99 } | 96 } |
100 const std::vector<std::string>& issuer_ca_ref_list() const { | 97 const std::vector<std::string>& issuer_ca_pems() const { |
101 return issuer_ca_ref_list_; | 98 return issuer_ca_pems_; |
102 } | 99 } |
103 const std::vector<std::string>& enrollment_uri_list() const { | 100 const std::vector<std::string>& enrollment_uri_list() const { |
104 return enrollment_uri_list_; | 101 return enrollment_uri_list_; |
105 } | 102 } |
106 | 103 |
107 // Creates a new dictionary containing the data in the certificate pattern. | 104 // Creates a new dictionary containing the data in the certificate pattern. |
108 base::DictionaryValue* CreateAsDictionary() const; | 105 base::DictionaryValue* CreateAsDictionary() const; |
109 | 106 |
110 // Replaces the contents of this CertificatePattern object with | 107 // Replaces the contents of this CertificatePattern object with |
111 // the values in the dictionary. Returns false if the dictionary is | 108 // the values in the dictionary. Returns false if the dictionary is |
112 // malformed. | 109 // malformed. |
113 bool CopyFromDictionary(const base::DictionaryValue& dictionary); | 110 bool CopyFromDictionary(const base::DictionaryValue& dictionary); |
114 | 111 |
115 private: | 112 private: |
116 std::vector<std::string> issuer_ca_ref_list_; | 113 std::vector<std::string> issuer_ca_pems_; |
117 IssuerSubjectPattern issuer_; | 114 IssuerSubjectPattern issuer_; |
118 IssuerSubjectPattern subject_; | 115 IssuerSubjectPattern subject_; |
119 std::vector<std::string> enrollment_uri_list_; | 116 std::vector<std::string> enrollment_uri_list_; |
120 }; | 117 }; |
121 | 118 |
122 } // namespace chromeos | 119 } // namespace chromeos |
123 | 120 |
124 #endif // CHROMEOS_NETWORK_CERTIFICATE_PATTERN_H_ | 121 #endif // CHROMEOS_NETWORK_CERTIFICATE_PATTERN_H_ |
OLD | NEW |