| 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
|
|
|