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

Side by Side Diff: owner_key.h

Issue 6469072: [login_manager] Use keygen helper to generate owner key (Closed) Base URL: http://git.chromium.org/git/login_manager.git@master
Patch Set: Add a few constants Created 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef LOGIN_MANAGER_OWNER_KEY_H_ 5 #ifndef LOGIN_MANAGER_OWNER_KEY_H_
6 #define LOGIN_MANAGER_OWNER_KEY_H_ 6 #define LOGIN_MANAGER_OWNER_KEY_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include <base/basictypes.h> 10 #include <base/basictypes.h>
11 #include <base/file_path.h> 11 #include <base/file_path.h>
12 #include <base/scoped_ptr.h> 12 #include <base/scoped_ptr.h>
13 13
14 namespace base { 14 namespace base {
15 class RSAPrivateKey; 15 class RSAPrivateKey;
16 class SignatureVerifier; 16 class SignatureVerifier;
17 } // namespace base 17 } // namespace base
18 18
19 namespace login_manager { 19 namespace login_manager {
20 class ChildJobInterface;
20 class SystemUtils; 21 class SystemUtils;
21 22
22 // This class holds the device owner's public key. 23 // This class holds the device owner's public key.
23 // 24 //
24 // If there is an owner key on disk, we will load that key, and deny 25 // If there is an owner key on disk, we will load that key, and deny
25 // attempts to set a new key programmatically. If there is no key 26 // attempts to set a new key programmatically. If there is no key
26 // present, we will allow the owner's key to be set programmatically, 27 // present, we will allow the owner's key to be set programmatically,
27 // and will persist it to disk upon request. Attempts to set the key 28 // and will persist it to disk upon request. Attempts to set the key
28 // before on-disk storage has been checked will be denied. 29 // before on-disk storage has been checked will be denied.
29 class OwnerKey { 30 class OwnerKey {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 const char* signature, 66 const char* signature,
66 uint32 sig_len); 67 uint32 sig_len);
67 68
68 // Generate |OUT_signature|, a valid sha1 w/ RSA signature over the data in 69 // Generate |OUT_signature|, a valid sha1 w/ RSA signature over the data in
69 // |data| that can be verified with |key_|. 70 // |data| that can be verified with |key_|.
70 // Returns false if the sig is invalid, or there's an error. 71 // Returns false if the sig is invalid, or there's an error.
71 virtual bool Sign(const char* data, 72 virtual bool Sign(const char* data,
72 uint32 data_len, 73 uint32 data_len,
73 std::vector<uint8>* OUT_signature); 74 std::vector<uint8>* OUT_signature);
74 75
76 // Runs |generator| in a child process. Returns pid of the child.
77 virtual int StartGeneration(ChildJobInterface* generator);
78
75 // Returned reference will be empty if we haven't populated |key_| yet. 79 // Returned reference will be empty if we haven't populated |key_| yet.
76 const std::vector<uint8>& public_key_der() const { 80 const std::vector<uint8>& public_key_der() const {
77 return key_; 81 return key_;
78 } 82 }
79 83
80 private: 84 private:
81 static const uint8 kAlgorithm[]; 85 static const uint8 kAlgorithm[];
82 86
83 const FilePath key_file_; 87 const FilePath key_file_;
84 bool have_checked_disk_; 88 bool have_checked_disk_;
85 std::vector<uint8> key_; 89 std::vector<uint8> key_;
86 scoped_ptr<SystemUtils> utils_; 90 scoped_ptr<SystemUtils> utils_;
87 91
88 DISALLOW_COPY_AND_ASSIGN(OwnerKey); 92 DISALLOW_COPY_AND_ASSIGN(OwnerKey);
89 }; 93 };
90 } // namespace login_manager 94 } // namespace login_manager
91 95
92 #endif // LOGIN_MANAGER_OWNER_KEY_H_ 96 #endif // LOGIN_MANAGER_OWNER_KEY_H_
OLDNEW
« no previous file with comments | « nss_util.cc ('k') | owner_key.cc » ('j') | session_manager_service.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698