Index: crypto/rsa_private_key.h |
diff --git a/crypto/rsa_private_key.h b/crypto/rsa_private_key.h |
index 221e341a6fe8da40b9753dc58df91598a53fd61a..74559f7c56ede32880a8fb034951f6b31d05aaeb 100644 |
--- a/crypto/rsa_private_key.h |
+++ b/crypto/rsa_private_key.h |
@@ -180,7 +180,21 @@ class CRYPTO_EXPORT RSAPrivateKey { |
static RSAPrivateKey* CreateFromPrivateKeyInfo( |
const std::vector<uint8>& input); |
-#if defined(USE_NSS) |
+#if defined(USE_OPENSSL) |
+ // Create a new instance from an existing EVP_PKEY, taking a |
+ // reference to it. |key| must be an RSA key. Returns NULL on |
+ // failure. |
+ static RSAPrivateKey* CreateFromKey(EVP_PKEY* key); |
+#else |
+ // Create a new instance by referencing an existing private key |
+ // structure. Does not import the key. |
+ static RSAPrivateKey* CreateFromKey(SECKEYPrivateKey* key); |
+#endif |
+ |
+#if defined(USE_NSS) && !defined(USE_OPENSSL) |
+ // TODO(davidben): These functions are used when NSS is the platform key |
+ // store, but they also assume that the internal crypto library is NSS. |
+ |
// Create a new random instance in |slot|. Can return NULL if initialization |
// fails. The created key is permanent and is not exportable in plaintext |
// form. |
@@ -194,10 +208,6 @@ class CRYPTO_EXPORT RSAPrivateKey { |
PK11SlotInfo* slot, |
const std::vector<uint8>& input); |
- // Create a new instance by referencing an existing private key |
- // structure. Does not import the key. |
- static RSAPrivateKey* CreateFromKey(SECKEYPrivateKey* key); |
- |
// Import an existing public key, and then search for the private |
// half in the key database. The format of the public key blob is is |
// an X509 SubjectPublicKeyInfo block. This can return NULL if |
@@ -216,13 +226,7 @@ class CRYPTO_EXPORT RSAPrivateKey { |
static RSAPrivateKey* FindFromPublicKeyInfoInSlot( |
const std::vector<uint8>& input, |
PK11SlotInfo* slot); |
-#elif defined(USE_OPENSSL) |
- // Create a new instance from an existing EVP_PKEY, taking a |
- // reference to it. |key| must be an RSA key. Returns NULL on |
- // failure. |
- static RSAPrivateKey* CreateFromKey(EVP_PKEY* key); |
- |
-#endif |
+#endif // USE_NSS && !USE_OPENSSL |
#if defined(USE_OPENSSL) |
EVP_PKEY* key() { return key_; } |