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

Unified Diff: crypto/rsa_private_key_win.cc

Issue 8727014: Implement RSAPrivateKey::Copy() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 1 month 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_win.cc
diff --git a/crypto/rsa_private_key_win.cc b/crypto/rsa_private_key_win.cc
index f7363422db8b18928e95c8b2bd98690a0bc7f3d4..7462caf73c40d3f5242a92e5a00eca35d1ba642a 100644
--- a/crypto/rsa_private_key_win.cc
+++ b/crypto/rsa_private_key_win.cc
@@ -134,6 +134,15 @@ bool RSAPrivateKey::InitProvider() {
PROV_RSA_FULL, CRYPT_VERIFYCONTEXT);
}
+RSAPrivateKey* RSAPrivateKey::Copy() const {
+ scoped_ptr<RSAPrivateKey> copy(new RSAPrivateKey());
+ if (!copy->InitProvider())
wtc 2011/11/30 00:58:10 Instead of calling copy->InitProvider(), I think i
Sergey Ulanov 2011/11/30 22:30:03 Done.
+ return NULL;
+ if (!CryptDuplicateKey(key_.get(), NULL, 0, copy->key_.receive()))
+ return NULL;
+ return copy.release();
+}
+
bool RSAPrivateKey::ExportPrivateKey(std::vector<uint8>* output) {
// Export the key
DWORD blob_length = 0;

Powered by Google App Engine
This is Rietveld 408576698