| 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 CHROME_BROWSER_CHROMEOS_NETWORK_SETTINGS_ONC_UTILS_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_NETWORK_SETTINGS_ONC_UTILS_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/memory/scoped_ptr.h" | |
| 11 | |
| 12 namespace base { | |
| 13 class DictionaryValue; | |
| 14 } | |
| 15 | |
| 16 namespace chromeos { | |
| 17 namespace onc { | |
| 18 | |
| 19 // Parses |json| according to the JSON format. If |json| is a JSON formatted | |
| 20 // dictionary, the function returns the dictionary as a DictionaryValue and | |
| 21 // doesn't modify |error|. Otherwise returns NULL and sets |error| to a | |
| 22 // translated error message. | |
| 23 scoped_ptr<base::DictionaryValue> ReadDictionaryFromJson( | |
| 24 const std::string& json, | |
| 25 std::string* error); | |
| 26 | |
| 27 // Decrypt the given EncryptedConfiguration |onc| (see the ONC specification) | |
| 28 // using |passphrase|. The resulting UnencryptedConfiguration is returned and | |
| 29 // |error| is not modified. If an error occurs, returns NULL and if additionally | |
| 30 // |error| is not NULL, |error| is set to a user readable error message. | |
| 31 scoped_ptr<base::DictionaryValue> Decrypt(const std::string& passphrase, | |
| 32 const base::DictionaryValue& onc, | |
| 33 std::string* error); | |
| 34 | |
| 35 } // chromeos | |
| 36 } // onc | |
| 37 | |
| 38 #endif // CHROME_BROWSER_CHROMEOS_NETWORK_SETTINGS_ONC_UTILS_H_ | |
| OLD | NEW |