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

Unified Diff: chrome/browser/policy/user_policy_key.h

Issue 12183017: Verify the signature on user cloud policy downloads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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
Index: chrome/browser/policy/user_policy_key.h
diff --git a/chrome/browser/policy/user_policy_key.h b/chrome/browser/policy/user_policy_key.h
new file mode 100644
index 0000000000000000000000000000000000000000..2b5afd406e6335dd9db63c79add8204c4c1e14ae
--- /dev/null
+++ b/chrome/browser/policy/user_policy_key.h
@@ -0,0 +1,39 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_POLICY_USER_POLICY_KEY_H_
+#define CHROME_BROWSER_POLICY_USER_POLICY_KEY_H_
+
+#include <vector>
+
+#include "base/basictypes.h"
+#include "base/callback_forward.h"
+#include "base/file_path.h"
+#include "base/memory/weak_ptr.h"
+#include "base/threading/non_thread_safe.h"
+
+namespace policy {
+
+class UserPolicyKey : public base::NonThreadSafe {
+ public:
+ explicit UserPolicyKey(const FilePath& path);
+ ~UserPolicyKey();
+
+ // Reloads the user policy key from |path_|, and posts |callback| to the
+ // message loop that owns the object.
+ void Load(const base::Closure& callback);
+
+ const std::vector<uint8>& key() const { return key_; }
+
+ private:
+ void OnKeyLoaded(std::vector<uint8>* key, const base::Closure& callback);
+
+ FilePath path_;
+ std::vector<uint8> key_;
+ base::WeakPtrFactory<UserPolicyKey> weak_ptr_factory_;
+};
+
+} // namespace policy
+
+#endif // CHROME_BROWSER_POLICY_USER_POLICY_KEY_H_

Powered by Google App Engine
This is Rietveld 408576698