| 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 |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "chromeos/chromeos_export.h" | 12 #include "chromeos/chromeos_export.h" |
| 13 | 13 |
| 14 namespace base { | 14 namespace base { |
| 15 class DictionaryValue; | 15 class DictionaryValue; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace chromeos { | 18 namespace chromeos { |
| 19 | 19 |
| 20 // Class to represent the DER fields of an issuer or a subject in a | 20 // Class to represent the DER fields of an issuer or a subject in a |
| 21 // certificate and compare them. | 21 // certificate and compare them. |
| 22 class CHROMEOS_EXPORT IssuerSubjectPattern { | 22 class CHROMEOS_EXPORT IssuerSubjectPattern { |
| 23 public: | 23 public: |
| 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(const IssuerSubjectPattern& other); |
| 29 ~IssuerSubjectPattern(); | 30 ~IssuerSubjectPattern(); |
| 30 | 31 |
| 31 // Returns true if all fields in the pattern are empty. | 32 // Returns true if all fields in the pattern are empty. |
| 32 bool Empty() const; | 33 bool Empty() const; |
| 33 | 34 |
| 34 // Clears out all values in this pattern. | 35 // Clears out all values in this pattern. |
| 35 void Clear(); | 36 void Clear(); |
| 36 | 37 |
| 37 const std::string& common_name() const { | 38 const std::string& common_name() const { |
| 38 return common_name_; | 39 return common_name_; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 56 std::string locality_; | 57 std::string locality_; |
| 57 std::string organization_; | 58 std::string organization_; |
| 58 std::string organizational_unit_; | 59 std::string organizational_unit_; |
| 59 }; | 60 }; |
| 60 | 61 |
| 61 // A class to contain a certificate pattern and find existing matches to the | 62 // A class to contain a certificate pattern and find existing matches to the |
| 62 // pattern in the certificate database. | 63 // pattern in the certificate database. |
| 63 class CHROMEOS_EXPORT CertificatePattern { | 64 class CHROMEOS_EXPORT CertificatePattern { |
| 64 public: | 65 public: |
| 65 CertificatePattern(); | 66 CertificatePattern(); |
| 67 CertificatePattern(const CertificatePattern& other); |
| 66 ~CertificatePattern(); | 68 ~CertificatePattern(); |
| 67 | 69 |
| 68 // Returns true if this pattern has nothing set (and so would match | 70 // Returns true if this pattern has nothing set (and so would match |
| 69 // all certs). Ignores enrollment_uri_; | 71 // all certs). Ignores enrollment_uri_; |
| 70 bool Empty() const; | 72 bool Empty() const; |
| 71 | 73 |
| 72 const IssuerSubjectPattern& issuer() const { | 74 const IssuerSubjectPattern& issuer() const { |
| 73 return issuer_; | 75 return issuer_; |
| 74 } | 76 } |
| 75 const IssuerSubjectPattern& subject() const { | 77 const IssuerSubjectPattern& subject() const { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 93 | 95 |
| 94 std::vector<std::string> issuer_ca_pems_; | 96 std::vector<std::string> issuer_ca_pems_; |
| 95 IssuerSubjectPattern issuer_; | 97 IssuerSubjectPattern issuer_; |
| 96 IssuerSubjectPattern subject_; | 98 IssuerSubjectPattern subject_; |
| 97 std::vector<std::string> enrollment_uri_list_; | 99 std::vector<std::string> enrollment_uri_list_; |
| 98 }; | 100 }; |
| 99 | 101 |
| 100 } // namespace chromeos | 102 } // namespace chromeos |
| 101 | 103 |
| 102 #endif // CHROMEOS_NETWORK_CERTIFICATE_PATTERN_H_ | 104 #endif // CHROMEOS_NETWORK_CERTIFICATE_PATTERN_H_ |
| OLD | NEW |