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

Unified Diff: crypto/rsa_private_key_nss.cc

Issue 881213004: Support building BoringSSL with NSS certificates. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 8 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 | « crypto/rsa_private_key.h ('k') | crypto/rsa_private_key_nss_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/rsa_private_key_nss.cc
diff --git a/crypto/rsa_private_key_nss.cc b/crypto/rsa_private_key_nss.cc
index 45b2be76c2418fac27c78d74d129caa28f72eb17..c9e6a87fde3cef6266fb5fe4333d17bba6ee7c1f 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_CERTS)
// 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));
« no previous file with comments | « crypto/rsa_private_key.h ('k') | crypto/rsa_private_key_nss_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698