From e9e13fcf62ef8c71576d6bebaa3e8c6b361ec935 Mon Sep 17 00:00:00 2001 From: lloyd Date: Tue, 15 Jun 2010 00:37:27 +0000 Subject: Simplify PKCS8::copy_key --- src/pubkey/pkcs8.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/pubkey/pkcs8.cpp') diff --git a/src/pubkey/pkcs8.cpp b/src/pubkey/pkcs8.cpp index 00993223f..243d3a6b3 100644 --- a/src/pubkey/pkcs8.cpp +++ b/src/pubkey/pkcs8.cpp @@ -257,13 +257,7 @@ Private_Key* load_key(const std::string& fsname, Private_Key* copy_key(const Private_Key& key, RandomNumberGenerator& rng) { - Pipe bits; - - bits.start_msg(); - PKCS8::encode(key, bits); - bits.end_msg(); - - DataSource_Memory source(bits.read_all()); + DataSource_Memory source(PEM_encode(key)); return PKCS8::load_key(source, rng); } -- cgit v1.2.3