From 746480537e2c6043d8f5d5dac624aee812a39991 Mon Sep 17 00:00:00 2001
From: "cmasone@google.com"
 <cmasone@google.com@0039d316-1c4b-4281-b951-d872f2087c98>
Date: Tue, 10 Aug 2010 19:37:51 +0000
Subject: On NSS-using platforms, add a way to use an existing keypair given
 only the pubkey

I'm reworking Chrome OS' OwnerManager class to leverage code in base/crypto.
For my code, I need a way to get at a keypair that was
previously generated and stored in the user's NSSDB, given only the public
half of the keypair.  Given that, I should be able to toss most of the code
in chrome/browser/chromeos/login/owner_key_utils.* and just use RSAPrivateKey
and the signature generation/verification code here in base/crypto

BUG=chromium-os:4485
TEST=base_unittests

Review URL: http://codereview.chromium.org/3032060

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55604 0039d316-1c4b-4281-b951-d872f2087c98
---
 base/crypto/rsa_private_key_mac.cc | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

(limited to 'base/crypto/rsa_private_key_mac.cc')

diff --git a/base/crypto/rsa_private_key_mac.cc b/base/crypto/rsa_private_key_mac.cc
index 6dc6a42..e46e93e 100644
--- a/base/crypto/rsa_private_key_mac.cc
+++ b/base/crypto/rsa_private_key_mac.cc
@@ -49,6 +49,12 @@ RSAPrivateKey* RSAPrivateKey::Create(uint16 num_bits) {
 }
 
 // static
+RSAPrivateKey* RSAPrivateKey::CreateSensitive(uint16 num_bits) {
+  NOTIMPLEMENTED();
+  return NULL;
+}
+
+// static
 RSAPrivateKey* RSAPrivateKey::CreateFromPrivateKeyInfo(
     const std::vector<uint8>& input) {
   if (input.empty())
@@ -103,6 +109,20 @@ RSAPrivateKey* RSAPrivateKey::CreateFromPrivateKeyInfo(
   return result.release();
 }
 
+// static
+RSAPrivateKey* RSAPrivateKey::CreateSensitiveFromPrivateKeyInfo(
+    const std::vector<uint8>& input) {
+  NOTIMPLEMENTED();
+  return NULL;
+}
+
+// static
+RSAPrivateKey* RSAPrivateKey::FindFromPublicKeyInfo(
+    const std::vector<uint8>& input) {
+  NOTIMPLEMENTED();
+  return NULL;
+}
+
 RSAPrivateKey::RSAPrivateKey() {
   memset(&key_, 0, sizeof(key_));
 
-- 
cgit v1.1