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

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

Issue 10824112: Move Chrome OS device settings stuff to chrome/browser/chromeos/settings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 8 years, 5 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
deleted file mode 100644
index 58e941baf96a7c5c409b2ae0fe1cae516383e9f8..0000000000000000000000000000000000000000
--- a/chrome/browser/chromeos/login/owner_key_utils.h
+++ /dev/null
@@ -1,90 +0,0 @@
-// Copyright (c) 2011 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_CHROMEOS_LOGIN_OWNER_KEY_UTILS_H_
-#define CHROME_BROWSER_CHROMEOS_LOGIN_OWNER_KEY_UTILS_H_
-
-#include <string>
-#include <vector>
-
-#include "base/basictypes.h"
-#include "base/gtest_prod_util.h"
-#include "base/memory/ref_counted.h"
-
-class FilePath;
-
-namespace crypto {
-class RSAPrivateKey;
-}
-
-namespace chromeos {
-
-class OwnerKeyUtilsTest;
-
-class OwnerKeyUtils : public base::RefCounted<OwnerKeyUtils> {
- public:
- class Factory {
- public:
- virtual OwnerKeyUtils* CreateOwnerKeyUtils() = 0;
- };
-
- OwnerKeyUtils();
-
- // Sets the factory used by the static method Create to create an
- // OwnerKeyUtils. OwnerKeyUtils does not take ownership of
- // |factory|. A value of NULL results in an OwnerKeyUtils being
- // created directly.
-#if defined(UNIT_TEST)
- static void set_factory(Factory* factory) { factory_ = factory; }
-#endif
-
- // Creates an OwnerKeyUtils, ownership returns to the caller. If there is no
- // Factory (the default) this creates and returns a new OwnerKeyUtils.
- static OwnerKeyUtils* Create();
-
- // 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,
- std::vector<uint8>* output) = 0;
-
- // Verfiy that |signature| is a Sha1-with-RSA signature over |data| with
- // |public_key|
- // Returns true if so, false on bad signature or other error.
- virtual bool Verify(const std::string& data,
- const std::vector<uint8> signature,
- const std::vector<uint8> public_key) = 0;
-
- // Sign |data| with |key| using Sha1 with RSA. If successful, return true
- // and populate |OUT_signature|.
- virtual bool Sign(const std::string& data,
- std::vector<uint8>* OUT_signature,
- crypto::RSAPrivateKey* key) = 0;
-
- // Looks for the private key associated with |key| in the default slot,
- // and returns it if it can be found. Returns NULL otherwise.
- // Caller takes ownership.
- virtual crypto::RSAPrivateKey* FindPrivateKey(
- const std::vector<uint8>& key) = 0;
-
- virtual FilePath GetOwnerKeyFilePath() = 0;
-
- 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(crypto::RSAPrivateKey* pair,
- const FilePath& key_file) = 0;
-
- private:
- friend class base::RefCounted<OwnerKeyUtils>;
- static Factory* factory_;
-
- FRIEND_TEST_ALL_PREFIXES(OwnerKeyUtilsTest, ExportImportPublicKey);
-};
-
-} // namespace chromeos
-
-#endif // CHROME_BROWSER_CHROMEOS_LOGIN_OWNER_KEY_UTILS_H_
« no previous file with comments | « chrome/browser/chromeos/login/mock_signed_settings_helper.cc ('k') | chrome/browser/chromeos/login/owner_key_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698