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

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

Issue 3078001: Update OwnerKeyUtils API (Closed)
Patch Set: address comments Created 10 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/owner_key_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5d96c78cc4c3b368e67af221ea231d2ea6e05d4c..20becab317e5667820546bddf9fa7245714305c6 100644
--- a/chrome/browser/chromeos/login/owner_key_utils.h
+++ b/chrome/browser/chromeos/login/owner_key_utils.h
@@ -19,6 +19,8 @@ typedef struct SECItemStr SECItem;
class FilePath;
+namespace chromeos {
+
class OwnerKeyUtils {
public:
class Factory {
@@ -53,19 +55,40 @@ class OwnerKeyUtils {
virtual bool GenerateKeyPair(SECKEYPrivateKey** private_key_out,
SECKEYPublicKey** public_key_out) = 0;
+ // DER encodes |key| and exports it via DBus.
+ // The data sent is a DER-encoded X509 SubjectPublicKeyInfo object.
+ // Returns false on error.
+ virtual bool ExportPublicKeyViaDbus(SECKEYPublicKey* key) = 0;
+
// DER encodes |key| and writes it out to |key_file|.
// The blob on disk is a DER-encoded X509 SubjectPublicKeyInfo object.
// Returns false on error.
- virtual bool ExportPublicKey(SECKEYPublicKey* key,
- const FilePath& key_file) = 0;
+ virtual bool ExportPublicKeyToFile(SECKEYPublicKey* key,
+ const FilePath& key_file) = 0;
// Assumes that the file at |key_file| exists.
// Caller takes ownership of returned object; returns NULL on error.
// To free, call SECKEY_DestroyPublicKey.
virtual SECKEYPublicKey* ImportPublicKey(const FilePath& key_file) = 0;
+
+ // Looks for the private key associated with |key| in the default slot,
+ // and returns it if it can be found. Returns NULL otherwise.
+ // To free, call SECKEY_DestroyPrivateKey.
+ virtual SECKEYPrivateKey* FindPrivateKey(SECKEYPublicKey* key) = 0;
+
+ // If something's gone wrong with key generation or key exporting, the
+ // caller may wish to nuke some keys. This will destroy key objects in
+ // memory and ALSO remove them from the NSS database.
+ virtual void DestroyKeys(SECKEYPrivateKey* private_key,
+ SECKEYPublicKey* public_key) = 0;
+
+ virtual FilePath GetOwnerKeyFilePath() = 0;
+
private:
static Factory* factory_;
};
+} // namespace chromeos
+
#endif // CHROME_BROWSER_CHROMEOS_LOGIN_OWNER_KEY_UTILS_H_
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/owner_key_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698