Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(472)

Unified Diff: chromeos/network/onc/onc_utils.h

Issue 17471005: Move PEM certificate decoding to onc_utils. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/network/onc/onc_certificate_importer.cc ('k') | chromeos/network/onc/onc_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/onc/onc_utils.h
diff --git a/chromeos/network/onc/onc_utils.h b/chromeos/network/onc/onc_utils.h
index 6a6d273fe62f13d27682e98b4999c355330b91b8..d604cfc67a755252ffa17a2d988619db718514b4 100644
--- a/chromeos/network/onc/onc_utils.h
+++ b/chromeos/network/onc/onc_utils.h
@@ -8,9 +8,11 @@
#include <string>
#include "base/basictypes.h"
+#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "chromeos/chromeos_export.h"
#include "chromeos/network/onc/onc_constants.h"
+#include "net/cert/x509_certificate.h"
namespace base {
class DictionaryValue;
@@ -49,8 +51,8 @@ class CHROMEOS_EXPORT StringSubstitution {
virtual ~StringSubstitution() {}
// Returns the replacement string for |placeholder| in
- // |substitute|. Currently, onc::substitutes::kLoginIDField and
- // onc::substitutes::kEmailField are supported.
+ // |substitute|. Currently, substitutes::kLoginIDField and
+ // substitutes::kEmailField are supported.
virtual bool GetSubstitute(std::string placeholder,
std::string* substitute) const = 0;
private:
@@ -59,8 +61,8 @@ class CHROMEOS_EXPORT StringSubstitution {
// Replaces all expandable fields that are mentioned in the ONC
// specification. The object of |onc_object| is modified in place. Currently
-// onc::substitutes::kLoginIDField and onc::substitutes::kEmailField are
-// expanded. The replacement strings are obtained from |substitution|.
+// substitutes::kLoginIDField and substitutes::kEmailField are expanded. The
+// replacement strings are obtained from |substitution|.
CHROMEOS_EXPORT void ExpandStringsInOncObject(
const OncValueSignature& signature,
const StringSubstitution& substitution,
@@ -81,11 +83,17 @@ CHROMEOS_EXPORT scoped_ptr<base::DictionaryValue> MaskCredentialsInOncObject(
// output lists and should be further processed by the caller.
CHROMEOS_EXPORT bool ParseAndValidateOncForImport(
const std::string& onc_blob,
- chromeos::onc::ONCSource onc_source,
+ ONCSource onc_source,
const std::string& passphrase,
base::ListValue* network_configs,
base::ListValue* certificates);
+// Parse the given PEM encoded certificate |pem_encoded| and create a
+// X509Certificate from it.
+CHROMEOS_EXPORT scoped_refptr<net::X509Certificate> DecodePEMCertificate(
+ const std::string& pem_encoded,
+ const std::string& nickname);
+
} // namespace onc
} // namespace chromeos
« no previous file with comments | « chromeos/network/onc/onc_certificate_importer.cc ('k') | chromeos/network/onc/onc_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698