diff options
author | lloyd <[email protected]> | 2010-03-04 02:18:00 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-03-04 02:18:00 +0000 |
commit | af204bf9828c20e485f9c9bde98160bd3506e81a (patch) | |
tree | d6cf6d48dc75899040989ca689a4a2877d9bb7e0 /src/pubkey/ecc_key | |
parent | bc66f1dc8ace6b81c486392422d3302afd674f37 (diff) |
Kill pkcs8_encoder
Diffstat (limited to 'src/pubkey/ecc_key')
-rw-r--r-- | src/pubkey/ecc_key/ecc_key.cpp | 33 | ||||
-rw-r--r-- | src/pubkey/ecc_key/ecc_key.h | 6 |
2 files changed, 4 insertions, 35 deletions
diff --git a/src/pubkey/ecc_key/ecc_key.cpp b/src/pubkey/ecc_key/ecc_key.cpp index b09ddfdb7..2f98eb691 100644 --- a/src/pubkey/ecc_key/ecc_key.cpp +++ b/src/pubkey/ecc_key/ecc_key.cpp @@ -149,32 +149,6 @@ MemoryVector<byte> EC_PrivateKey::pkcs8_private_key() const } /** -* Return the PKCS #8 public key encoder -**/ -PKCS8_Encoder* EC_PrivateKey::pkcs8_encoder() const - { - class EC_Key_Encoder : public PKCS8_Encoder - { - public: - AlgorithmIdentifier alg_id() const - { - return key->algorithm_identifier(); - } - - MemoryVector<byte> key_bits() const - { - return key->pkcs8_private_key(); - } - - EC_Key_Encoder(const EC_PrivateKey* k): key(k) {} - private: - const EC_PrivateKey* key; - }; - - return new EC_Key_Encoder(this); - } - -/** * Return the PKCS #8 public key decoder */ PKCS8_Decoder* EC_PrivateKey::pkcs8_decoder(RandomNumberGenerator&) @@ -199,10 +173,11 @@ PKCS8_Decoder* EC_PrivateKey::pkcs8_decoder(RandomNumberGenerator&) .verify_end() .end_cons(); - key->private_key = BigInt::decode(octstr_secret, octstr_secret.size()); - if(version != 1) - throw Decoding_Error("Wrong PKCS #1 key format version for EC key"); + throw Decoding_Error("Wrong key format version for EC key"); + + key->private_key = BigInt::decode(octstr_secret, + octstr_secret.size()); key->PKCS8_load_hook(); } diff --git a/src/pubkey/ecc_key/ecc_key.h b/src/pubkey/ecc_key/ecc_key.h index 8fcb7454f..6f3ab6a01 100644 --- a/src/pubkey/ecc_key/ecc_key.h +++ b/src/pubkey/ecc_key/ecc_key.h @@ -113,12 +113,6 @@ class BOTAN_DLL EC_PrivateKey : public virtual EC_PublicKey, MemoryVector<byte> pkcs8_private_key() const; /** - * Get an PKCS#8 encoder that can be used to encoded this key. - * @result an PKCS#8 encoder for this key - */ - PKCS8_Encoder* pkcs8_encoder() const; - - /** * Get an PKCS#8 decoder that can be used to decoded a stored key into * this key. * @result an PKCS#8 decoder for this key |