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

Unified Diff: crypto/rsa_private_key.h

Issue 14941007: Add RSAPrivateKey::CreateFromKeypair() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add NULL checks for key_, public_key_ Created 7 years, 7 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 | crypto/rsa_private_key_nss.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/rsa_private_key.h
diff --git a/crypto/rsa_private_key.h b/crypto/rsa_private_key.h
index ff368d82ace88b6576dfdf2d154cce4b8a811ef3..b8ce1690f1689c14838845623aa22aba4b7116ea 100644
--- a/crypto/rsa_private_key.h
+++ b/crypto/rsa_private_key.h
@@ -12,8 +12,8 @@
typedef struct evp_pkey_st EVP_PKEY;
#elif defined(USE_NSS)
// Forward declaration.
-struct SECKEYPrivateKeyStr;
-struct SECKEYPublicKeyStr;
+typedef struct SECKEYPrivateKeyStr SECKEYPrivateKey;
+typedef struct SECKEYPublicKeyStr SECKEYPublicKey;
#elif defined(OS_IOS)
#include <Security/Security.h>
#elif defined(OS_MACOSX)
@@ -200,6 +200,12 @@ class CRYPTO_EXPORT RSAPrivateKey {
static RSAPrivateKey* CreateSensitiveFromPrivateKeyInfo(
const std::vector<uint8>& input);
+#if defined(USE_NSS)
+ // Create a new instance by referencing an existing private key
+ // structure. Does not import the key.
+ static RSAPrivateKey* CreateFromKey(SECKEYPrivateKey* key);
+#endif
+
// 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
@@ -214,8 +220,8 @@ class CRYPTO_EXPORT RSAPrivateKey {
#if defined(USE_OPENSSL)
EVP_PKEY* key() { return key_; }
#elif defined(USE_NSS)
- SECKEYPrivateKeyStr* key() { return key_; }
- SECKEYPublicKeyStr* public_key() { return public_key_; }
+ SECKEYPrivateKey* key() { return key_; }
+ SECKEYPublicKey* public_key() { return public_key_; }
#elif defined(OS_WIN)
HCRYPTPROV provider() { return provider_; }
HCRYPTKEY key() { return key_; }
@@ -261,8 +267,8 @@ class CRYPTO_EXPORT RSAPrivateKey {
#if defined(USE_OPENSSL)
EVP_PKEY* key_;
#elif defined(USE_NSS)
- SECKEYPrivateKeyStr* key_;
- SECKEYPublicKeyStr* public_key_;
+ SECKEYPrivateKey* key_;
+ SECKEYPublicKey* public_key_;
#elif defined(OS_WIN)
bool InitProvider();
« no previous file with comments | « no previous file | crypto/rsa_private_key_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698