From 9f5b5fc96913e2a17573287e8aa88f0510d52c1b Mon Sep 17 00:00:00 2001 From: René Korthaus Date: Mon, 5 Dec 2016 10:20:06 +0100 Subject: Add Private_Key::private_key_info() Adds new Private_Key::private_key_info() that returns a PKCS#8 PrivateKeyInfo structure. Renames the current Private_Key::pkcs8_private_key() to private_key_bits(). BER_encode() just invokes private_key_info(). --- src/lib/pubkey/pkcs8.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'src/lib/pubkey/pkcs8.cpp') diff --git a/src/lib/pubkey/pkcs8.cpp b/src/lib/pubkey/pkcs8.cpp index f74eb4387..7857e3ee0 100644 --- a/src/lib/pubkey/pkcs8.cpp +++ b/src/lib/pubkey/pkcs8.cpp @@ -129,15 +129,8 @@ secure_vector PKCS8_decode( */ secure_vector BER_encode(const Private_Key& key) { - const size_t PKCS8_VERSION = 0; - - return DER_Encoder() - .start_cons(SEQUENCE) - .encode(PKCS8_VERSION) - .encode(key.pkcs8_algorithm_identifier()) - .encode(key.pkcs8_private_key(), OCTET_STRING) - .end_cons() - .get_contents(); + // keeping around for compat + return key.private_key_info(); } /* -- cgit v1.2.3