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_ONC_ONC_UTILS_H_ | 5 #ifndef CHROMEOS_NETWORK_ONC_ONC_UTILS_H_ |
6 #define CHROMEOS_NETWORK_ONC_ONC_UTILS_H_ | 6 #define CHROMEOS_NETWORK_ONC_ONC_UTILS_H_ |
7 | 7 |
| 8 #include <map> |
8 #include <string> | 9 #include <string> |
9 | 10 |
10 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
11 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
12 #include "chromeos/chromeos_export.h" | 13 #include "chromeos/chromeos_export.h" |
13 #include "chromeos/network/onc/onc_constants.h" | 14 #include "chromeos/network/onc/onc_constants.h" |
| 15 #include "net/cert/x509_certificate.h" |
14 | 16 |
15 namespace base { | 17 namespace base { |
16 class DictionaryValue; | 18 class DictionaryValue; |
17 class ListValue; | 19 class ListValue; |
18 } | 20 } |
19 | 21 |
20 namespace chromeos { | 22 namespace chromeos { |
21 namespace onc { | 23 namespace onc { |
22 | 24 |
23 struct OncValueSignature; | 25 struct OncValueSignature; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 // and Certificates of |onc_blob|. Returns false if any validation errors or | 81 // and Certificates of |onc_blob|. Returns false if any validation errors or |
80 // warnings occurred. Still, some networks or certificates might be added to the | 82 // warnings occurred. Still, some networks or certificates might be added to the |
81 // output lists and should be further processed by the caller. | 83 // output lists and should be further processed by the caller. |
82 CHROMEOS_EXPORT bool ParseAndValidateOncForImport( | 84 CHROMEOS_EXPORT bool ParseAndValidateOncForImport( |
83 const std::string& onc_blob, | 85 const std::string& onc_blob, |
84 chromeos::onc::ONCSource onc_source, | 86 chromeos::onc::ONCSource onc_source, |
85 const std::string& passphrase, | 87 const std::string& passphrase, |
86 base::ListValue* network_configs, | 88 base::ListValue* network_configs, |
87 base::ListValue* certificates); | 89 base::ListValue* certificates); |
88 | 90 |
| 91 CHROMEOS_EXPORT std::string GetHexFingerprintOfCert( |
| 92 const net::X509Certificate& cert); |
| 93 |
| 94 CHROMEOS_EXPORT net::X509Certificate* FindCertByFingerprint( |
| 95 const net::CertificateList& cert_list, const std::string& fingerprint); |
| 96 |
| 97 CHROMEOS_EXPORT std::string GetPEMEncodedCertFromFingerprint( |
| 98 const net::CertificateList& cert_list, |
| 99 const std::string& fingerprint); |
| 100 |
| 101 CHROMEOS_EXPORT bool ResolveServerCertRefsInNetworks( |
| 102 const std::map<std::string, |
| 103 scoped_refptr<net::X509Certificate> >& certs_by_guid, |
| 104 base::ListValue* network_configs); |
| 105 |
| 106 CHROMEOS_EXPORT bool ResolveServerCertRefsInNetwork( |
| 107 const std::map<std::string, |
| 108 scoped_refptr<net::X509Certificate> >& certs_by_guid, |
| 109 base::DictionaryValue* network_configs); |
| 110 |
89 } // namespace onc | 111 } // namespace onc |
90 } // namespace chromeos | 112 } // namespace chromeos |
91 | 113 |
92 #endif // CHROMEOS_NETWORK_ONC_ONC_UTILS_H_ | 114 #endif // CHROMEOS_NETWORK_ONC_ONC_UTILS_H_ |
OLD | NEW |