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

Unified Diff: chrome/browser/chromeos/login/owner_key_utils.h

Issue 6538098: [Chrome OS] Owner keys are generated outside Chrome now; handle appropriately (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/owner_key_utils.h
diff --git a/chrome/browser/chromeos/login/owner_key_utils.h b/chrome/browser/chromeos/login/owner_key_utils.h
index 49217457d9d6e3fa3f8f98c5ba40b3d2eecdac0a..de47a14359e4d464fee316cbde11fc531b8f6019 100644
--- a/chrome/browser/chromeos/login/owner_key_utils.h
+++ b/chrome/browser/chromeos/login/owner_key_utils.h
@@ -9,6 +9,7 @@
#include <vector>
#include "base/basictypes.h"
+#include "base/gtest_prod_util.h"
#include "base/ref_counted.h"
#include "chrome/browser/chromeos/cros/login_library.h"
@@ -20,6 +21,8 @@ class RSAPrivateKey;
namespace chromeos {
+class OwnerKeyUtilsTest;
+
class OwnerKeyUtils : public base::RefCounted<OwnerKeyUtils> {
public:
class Factory {
@@ -41,27 +44,6 @@ class OwnerKeyUtils : public base::RefCounted<OwnerKeyUtils> {
// Factory (the default) this creates and returns a new OwnerKeyUtils.
static OwnerKeyUtils* Create();
- // Generate a public/private RSA keypair and store them in the NSS database.
- // The keys will be kKeySizeInBits in length (Recommend >= 2048 bits).
- // The caller takes ownership.
- //
- // Returns NULL on error.
- virtual base::RSAPrivateKey* GenerateKeyPair() = 0;
-
- // DER encodes public half of |pair| and asynchronously exports it via DBus.
- // The data sent is a DER-encoded X509 SubjectPublicKeyInfo object.
- // Returns false on error, true if the attempt is successfully begun.
- // d->Run() will be called with a boolean indicating success or failure when
- // the attempt is complete.
- virtual bool ExportPublicKeyViaDbus(base::RSAPrivateKey* pair,
- LoginLibrary::Delegate* d) = 0;
-
- // DER encodes public half of |pair| and writes it out to |key_file|.
- // The blob on disk is a DER-encoded X509 SubjectPublicKeyInfo object.
- // Returns false on error.
- virtual bool ExportPublicKeyToFile(base::RSAPrivateKey* pair,
- const FilePath& key_file) = 0;
-
// Assumes that the file at |key_file| exists.
// Upon success, returns true and populates |output|. False on failure.
virtual bool ImportPublicKey(const FilePath& key_file,
@@ -91,9 +73,17 @@ class OwnerKeyUtils : public base::RefCounted<OwnerKeyUtils> {
protected:
virtual ~OwnerKeyUtils();
+ // DER encodes public half of |pair| and writes it out to |key_file|.
+ // The blob on disk is a DER-encoded X509 SubjectPublicKeyInfo object.
+ // Returns false on error.
+ virtual bool ExportPublicKeyToFile(base::RSAPrivateKey* pair,
+ const FilePath& key_file) = 0;
+
private:
friend class base::RefCounted<OwnerKeyUtils>;
static Factory* factory_;
+
+ FRIEND_TEST_ALL_PREFIXES(OwnerKeyUtilsTest, ExportImportPublicKey);
};
} // namespace chromeos
« no previous file with comments | « chrome/browser/chromeos/login/mock_ownership_service.h ('k') | chrome/browser/chromeos/login/owner_key_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698