Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(497)

Side by Side Diff: chromeos/network/certificate_pattern.h

Issue 370623002: Remove most of NetworkUIData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed yet-another unused function. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/chromeos/net/onc_utils.cc ('k') | chromeos/network/certificate_pattern.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 13 matching lines...) Expand all
24 IssuerSubjectPattern(); 24 IssuerSubjectPattern();
25 IssuerSubjectPattern(const std::string& common_name, 25 IssuerSubjectPattern(const std::string& common_name,
26 const std::string& locality, 26 const std::string& locality,
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 (so Empty returns true). 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; } 37 void set_common_name(const std::string& name) { common_name_ = name; }
38 void set_locality(const std::string& locality) { locality_ = locality; } 38 void set_locality(const std::string& locality) { locality_ = locality; }
39 void set_organization(const std::string& organization) { 39 void set_organization(const std::string& organization) {
40 organization_ = organization; 40 organization_ = organization;
41 } 41 }
42 void set_organizational_unit(const std::string& unit) { 42 void set_organizational_unit(const std::string& unit) {
43 organizational_unit_ = unit; 43 organizational_unit_ = unit;
44 } 44 }
45 45
46 const std::string& common_name() const { 46 const std::string& common_name() const {
47 return common_name_; 47 return common_name_;
48 } 48 }
49 const std::string& locality() const { 49 const std::string& locality() const {
50 return locality_; 50 return locality_;
51 } 51 }
52 const std::string& organization() const { 52 const std::string& organization() const {
53 return organization_; 53 return organization_;
54 } 54 }
55 const std::string& organizational_unit() const { 55 const std::string& organizational_unit() const {
56 return organizational_unit_; 56 return organizational_unit_;
57 } 57 }
58 58
59 // Creates a new dictionary containing the data in this pattern.
60 scoped_ptr<base::DictionaryValue> CreateONCDictionary() const;
61
62 // Replaces the content of this object with the values of |dictionary|. 59 // Replaces the content of this object with the values of |dictionary|.
63 // |dictionary| should be a valid ONC IssuerSubjectPattern dictionary. 60 // |dictionary| should be a valid ONC IssuerSubjectPattern dictionary.
64 void ReadFromONCDictionary(const base::DictionaryValue& dictionary); 61 void ReadFromONCDictionary(const base::DictionaryValue& dictionary);
65 62
66 private: 63 private:
67 std::string common_name_; 64 std::string common_name_;
68 std::string locality_; 65 std::string locality_;
69 std::string organization_; 66 std::string organization_;
70 std::string organizational_unit_; 67 std::string organizational_unit_;
71 }; 68 };
72 69
73 // A class to contain a certificate pattern and find existing matches to the 70 // A class to contain a certificate pattern and find existing matches to the
74 // pattern in the certificate database. 71 // pattern in the certificate database.
75 class CHROMEOS_EXPORT CertificatePattern { 72 class CHROMEOS_EXPORT CertificatePattern {
76 public: 73 public:
77 CertificatePattern(); 74 CertificatePattern();
78 ~CertificatePattern(); 75 ~CertificatePattern();
79 76
80 // Returns true if this pattern has nothing set (and so would match 77 // Returns true if this pattern has nothing set (and so would match
81 // all certs). Ignores enrollment_uri_; 78 // all certs). Ignores enrollment_uri_;
82 bool Empty() const; 79 bool Empty() const;
83 80
84 // Clears out all the values in this pattern (so Empty returns true).
85 void Clear();
86
87 void set_issuer(const IssuerSubjectPattern& issuer) { issuer_ = issuer; } 81 void set_issuer(const IssuerSubjectPattern& issuer) { issuer_ = issuer; }
88 void set_subject(const IssuerSubjectPattern& subject) { subject_ = subject; } 82 void set_subject(const IssuerSubjectPattern& subject) { subject_ = subject; }
89 void set_enrollment_uri_list(const std::vector<std::string>& uri_list) { 83 void set_enrollment_uri_list(const std::vector<std::string>& uri_list) {
90 enrollment_uri_list_ = uri_list; 84 enrollment_uri_list_ = uri_list;
91 } 85 }
92 86
93 const IssuerSubjectPattern& issuer() const { 87 const IssuerSubjectPattern& issuer() const {
94 return issuer_; 88 return issuer_;
95 } 89 }
96 const IssuerSubjectPattern& subject() const { 90 const IssuerSubjectPattern& subject() const {
97 return subject_; 91 return subject_;
98 } 92 }
99 const std::vector<std::string>& issuer_ca_pems() const { 93 const std::vector<std::string>& issuer_ca_pems() const {
100 return issuer_ca_pems_; 94 return issuer_ca_pems_;
101 } 95 }
102 const std::vector<std::string>& enrollment_uri_list() const { 96 const std::vector<std::string>& enrollment_uri_list() const {
103 return enrollment_uri_list_; 97 return enrollment_uri_list_;
104 } 98 }
105 99
106 // Creates a new dictionary containing the data in the certificate pattern.
107 scoped_ptr<base::DictionaryValue> CreateONCDictionary() const;
108
109 // Replaces the content of this object with the values of |dictionary|. 100 // Replaces the content of this object with the values of |dictionary|.
110 // |dictionary| should be a valid ONC CertificatePattern dictionary. Returns 101 // |dictionary| should be a valid ONC CertificatePattern dictionary. Returns
111 // whether all required fields were present. 102 // whether all required fields were present.
112 bool ReadFromONCDictionary(const base::DictionaryValue& dictionary); 103 bool ReadFromONCDictionary(const base::DictionaryValue& dictionary);
113 104
114 private: 105 private:
106 // Clears out all the values in this pattern.
107 void Clear();
108
115 std::vector<std::string> issuer_ca_pems_; 109 std::vector<std::string> issuer_ca_pems_;
116 IssuerSubjectPattern issuer_; 110 IssuerSubjectPattern issuer_;
117 IssuerSubjectPattern subject_; 111 IssuerSubjectPattern subject_;
118 std::vector<std::string> enrollment_uri_list_; 112 std::vector<std::string> enrollment_uri_list_;
119 }; 113 };
120 114
121 } // namespace chromeos 115 } // namespace chromeos
122 116
123 #endif // CHROMEOS_NETWORK_CERTIFICATE_PATTERN_H_ 117 #endif // CHROMEOS_NETWORK_CERTIFICATE_PATTERN_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/net/onc_utils.cc ('k') | chromeos/network/certificate_pattern.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698