Index: crypto/rsa_private_key_nss.cc |
diff --git a/crypto/rsa_private_key_nss.cc b/crypto/rsa_private_key_nss.cc |
index c51e308419d5b0b831bdf40fa1f9612980b7b820..5fb9d1d66788411b518d02be1c3bd433070f378e 100644 |
--- a/crypto/rsa_private_key_nss.cc |
+++ b/crypto/rsa_private_key_nss.cc |
@@ -104,6 +104,22 @@ RSAPrivateKey* RSAPrivateKey::CreateFromPrivateKeyInfo( |
false /* not sensitive */); |
} |
+// static |
+RSAPrivateKey* RSAPrivateKey::CreateFromKey(SECKEYPrivateKey* key) { |
+ DCHECK(key); |
+ if (SECKEY_GetPrivateKeyType(key) != rsaKey) |
+ return NULL; |
+ RSAPrivateKey* copy = new RSAPrivateKey(); |
+ copy->key_ = SECKEY_CopyPrivateKey(key); |
+ copy->public_key_ = SECKEY_ConvertToPublicKey(key); |
+ if (!copy->key_ || !copy->public_key_) { |
+ NOTREACHED(); |
+ delete copy; |
+ return NULL; |
+ } |
+ return copy; |
+} |
+ |
#if defined(USE_NSS) |
// static |
RSAPrivateKey* RSAPrivateKey::CreateSensitive(PK11SlotInfo* slot, |
@@ -125,22 +141,6 @@ RSAPrivateKey* RSAPrivateKey::CreateSensitiveFromPrivateKeyInfo( |
} |
// static |
-RSAPrivateKey* RSAPrivateKey::CreateFromKey(SECKEYPrivateKey* key) { |
- DCHECK(key); |
- if (SECKEY_GetPrivateKeyType(key) != rsaKey) |
- return NULL; |
- RSAPrivateKey* copy = new RSAPrivateKey(); |
- copy->key_ = SECKEY_CopyPrivateKey(key); |
- copy->public_key_ = SECKEY_ConvertToPublicKey(key); |
- if (!copy->key_ || !copy->public_key_) { |
- NOTREACHED(); |
- delete copy; |
- return NULL; |
- } |
- return copy; |
-} |
- |
-// static |
RSAPrivateKey* RSAPrivateKey::FindFromPublicKeyInfo( |
const std::vector<uint8>& input) { |
scoped_ptr<RSAPrivateKey> result(InitPublicPart(input)); |