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

Side by Side Diff: chrome/browser/chromeos/login/mock_owner_key_util.h

Issue 10828032: Add DeviceSettingsService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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_LOGIN_MOCK_OWNER_KEY_UTIL_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_MOCK_OWNER_KEY_UTIL_H_
7
8 #include <vector>
9
10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h"
12 #include "base/file_path.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "chrome/browser/chromeos/login/owner_key_util.h"
15
16 namespace chromeos {
17
18 class MockOwnerKeyUtil : public OwnerKeyUtil {
19 public:
20 MockOwnerKeyUtil();
21
22 // OwnerKeyUtil:
23 virtual bool ImportPublicKey(std::vector<uint8>* output) OVERRIDE;
24 virtual crypto::RSAPrivateKey* FindPrivateKey(
25 const std::vector<uint8>& key) OVERRIDE;
26 virtual bool IsPublicKeyPresent() OVERRIDE;
27
28 // Configures the mock to return the given public key.
29 void SetPublicKey(const std::vector<uint8>& key);
30
31 // Sets the public key to use from the given private key, but doesn't
32 // configure the private key.
33 void SetPublicKeyFromPrivateKey(crypto::RSAPrivateKey* key);
34
35 // Sets the private key (also configures the public key).
36 void SetPrivateKey(crypto::RSAPrivateKey* key);
37
38 protected:
39 virtual ~MockOwnerKeyUtil();
40
41 // OwnerKeyUtil:
42 virtual bool ExportPublicKey(crypto::RSAPrivateKey* pair);
43
44 private:
45 std::vector<uint8> public_key_;
46 scoped_ptr<crypto::RSAPrivateKey> private_key_;
47
48 DISALLOW_COPY_AND_ASSIGN(MockOwnerKeyUtil);
49 };
50
51 } // namespace chromeos
52
53 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_MOCK_OWNER_KEY_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698