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

Unified Diff: crypto/rsa_private_key_nss.cc

Issue 14941007: Add RSAPrivateKey::CreateFromKeypair() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add Unittest 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
Index: crypto/rsa_private_key_nss.cc
diff --git a/crypto/rsa_private_key_nss.cc b/crypto/rsa_private_key_nss.cc
index 3b8bd4489a2446265d54cebe845b5fe1947ffc29..3cefcbed8f4b007fc6db124c29d33ba8505ebed7 100644
--- a/crypto/rsa_private_key_nss.cc
+++ b/crypto/rsa_private_key_nss.cc
@@ -81,6 +81,16 @@ RSAPrivateKey* RSAPrivateKey::CreateSensitiveFromPrivateKeyInfo(
}
// static
+RSAPrivateKey* RSAPrivateKey::CreateFromKeypair(
+ SECKEYPrivateKeyStr* key,
+ SECKEYPublicKeyStr* public_key) {
Ryan Sleevi 2013/05/07 19:45:23 From an API perspective, there should be a little
Chris Masone 2013/05/07 21:00:39 Done.
+ RSAPrivateKey* copy = new RSAPrivateKey();
+ copy->key_ = SECKEY_CopyPrivateKey(key);
+ copy->public_key_ = SECKEY_CopyPublicKey(public_key);
+ return copy;
+}
+
+// static
RSAPrivateKey* RSAPrivateKey::FindFromPublicKeyInfo(
const std::vector<uint8>& input) {
EnsureNSSInit();

Powered by Google App Engine
This is Rietveld 408576698