Chromium Code Reviews| 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 | |
| 13 namespace base { | |
| 14 class DictionaryValue; | |
| 15 } | |
| 16 | |
| 17 namespace chromeos { | |
| 18 namespace onc { | |
| 19 | |
| 20 CHROMEOS_EXPORT extern const char kResultSuccess[]; | |
| 21 CHROMEOS_EXPORT extern const char kErrorNotAJsonDictionary[]; | |
| 22 CHROMEOS_EXPORT extern const char kErrorEncryptedOncMalformed[]; | |
| 23 CHROMEOS_EXPORT extern const char kErrorEncryptedOncUnsupportedEncryption[]; | |
| 24 CHROMEOS_EXPORT extern const char kErrorEncryptedOncUnableToDecrypt[]; | |
| 25 CHROMEOS_EXPORT extern const char kErrorEncryptedOncTooManyIterations[]; | |
| 26 CHROMEOS_EXPORT extern const char kErrorEncryptedOncUnableToDecode[]; | |
| 27 CHROMEOS_EXPORT extern const char kErrorPropertyDictionaryMalformed[]; | |
| 28 | |
| 29 // Parses |json| according to the JSON format. If |json| is a JSON formatted | |
| 30 // dictionary, the function returns the dictionary as a DictionaryValue and | |
| 31 // doesn't modify |error|. Otherwise returns NULL and sets |error| to a | |
|
pneubeck (no reviews)
2012/12/04 10:43:56
|error| -> |result|
Greg Spencer (Chromium)
2012/12/07 18:12:27
Removed error.
| |
| 32 // non-user-facing (untranslated) error message. | |
| 33 CHROMEOS_EXPORT scoped_ptr<base::DictionaryValue> ReadDictionaryFromJson( | |
| 34 const std::string& json, | |
| 35 std::string* result); | |
| 36 | |
| 37 // Decrypt the given EncryptedConfiguration |onc| (see the ONC specification) | |
| 38 // using |passphrase|. The resulting UnencryptedConfiguration is returned and | |
| 39 // |error| is not modified. If an error occurs, returns NULL and if additionally | |
|
pneubeck (no reviews)
2012/12/04 10:43:56
|error| is always modified if not-null.
Greg Spencer (Chromium)
2012/12/07 18:12:27
removed error
| |
| 40 // |error| is not NULL, |error| is set to a non-user-facing (untranslated) error | |
|
pneubeck (no reviews)
2012/12/04 10:43:56
|error| -> |result|
Greg Spencer (Chromium)
2012/12/07 18:12:27
removed error
| |
| 41 // message. | |
| 42 CHROMEOS_EXPORT scoped_ptr<base::DictionaryValue> Decrypt( | |
| 43 const std::string& passphrase, | |
| 44 const base::DictionaryValue& onc, | |
| 45 std::string* result); | |
| 46 | |
| 47 } // chromeos | |
| 48 } // onc | |
| 49 | |
| 50 #endif // CHROMEOS_NETWORK_ONC_ONC_UTILS_H_ | |
| OLD | NEW |