OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROMEOS_NETWORK_ONC_ONC_UTILS_H_ |
| 6 #define CHROMEOS_NETWORK_ONC_ONC_UTILS_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "chromeos/chromeos_export.h" |
| 12 #include "chromeos/network/onc/onc_constants.h" |
| 13 |
| 14 namespace base { |
| 15 class DictionaryValue; |
| 16 } |
| 17 |
| 18 namespace chromeos { |
| 19 namespace onc { |
| 20 |
| 21 // Parses |json| according to the JSON format. If |json| is a JSON formatted |
| 22 // dictionary, the function returns the dictionary as a DictionaryValue. |
| 23 // Otherwise returns NULL. |
| 24 CHROMEOS_EXPORT scoped_ptr<base::DictionaryValue> ReadDictionaryFromJson( |
| 25 const std::string& json); |
| 26 |
| 27 // Decrypt the given EncryptedConfiguration |onc| (see the ONC specification) |
| 28 // using |passphrase|. The resulting UnencryptedConfiguration is returned. If an |
| 29 // error occurs, returns NULL. |
| 30 CHROMEOS_EXPORT scoped_ptr<base::DictionaryValue> Decrypt( |
| 31 const std::string& passphrase, |
| 32 const base::DictionaryValue& onc); |
| 33 |
| 34 // For logging only: strings not user facing. |
| 35 CHROMEOS_EXPORT std::string GetSourceAsString(ONCSource source); |
| 36 |
| 37 } // chromeos |
| 38 } // onc |
| 39 |
| 40 #endif // CHROMEOS_NETWORK_ONC_ONC_UTILS_H_ |
OLD | NEW |