aboutsummaryrefslogtreecommitdiffstats
path: root/src/pubkey/ecc_key
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-03-04 02:18:00 +0000
committerlloyd <[email protected]>2010-03-04 02:18:00 +0000
commitaf204bf9828c20e485f9c9bde98160bd3506e81a (patch)
treed6cf6d48dc75899040989ca689a4a2877d9bb7e0 /src/pubkey/ecc_key
parentbc66f1dc8ace6b81c486392422d3302afd674f37 (diff)
Kill pkcs8_encoder
Diffstat (limited to 'src/pubkey/ecc_key')
-rw-r--r--src/pubkey/ecc_key/ecc_key.cpp33
-rw-r--r--src/pubkey/ecc_key/ecc_key.h6
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