diff options
author | lloyd <[email protected]> | 2010-03-04 03:51:55 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-03-04 03:51:55 +0000 |
commit | e998558e1fa903b32155b694107082fff25f9c0e (patch) | |
tree | ed36916dc4aa216bd996d2ec308159741b2b0bf8 /src/pubkey/ecc_key/ecc_key.cpp | |
parent | fe9aa5acece6c004f2c1c1aa4b23d7c44207672f (diff) |
Kill pkcs8_decoder
Diffstat (limited to 'src/pubkey/ecc_key/ecc_key.cpp')
-rw-r--r-- | src/pubkey/ecc_key/ecc_key.cpp | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/src/pubkey/ecc_key/ecc_key.cpp b/src/pubkey/ecc_key/ecc_key.cpp index 4c91672d3..081649de3 100644 --- a/src/pubkey/ecc_key/ecc_key.cpp +++ b/src/pubkey/ecc_key/ecc_key.cpp @@ -162,48 +162,6 @@ EC_PrivateKey::EC_PrivateKey(const AlgorithmIdentifier& alg_id, public_key = domain().get_base_point() * private_key; } -/** -* Return the PKCS #8 public key decoder -*/ -PKCS8_Decoder* EC_PrivateKey::pkcs8_decoder(RandomNumberGenerator&) - { - class EC_Key_Decoder : public PKCS8_Decoder - { - public: - void alg_id(const AlgorithmIdentifier& alg_id) - { - key->domain_params = EC_Domain_Params(alg_id.parameters); - } - - void key_bits(const MemoryRegion<byte>& bits) - { - u32bit version; - SecureVector<byte> octstr_secret; - - BER_Decoder(bits) - .start_cons(SEQUENCE) - .decode(version) - .decode(octstr_secret, OCTET_STRING) - .verify_end() - .end_cons(); - - if(version != 1) - throw Decoding_Error("Wrong key format version for EC key"); - - key->private_key = BigInt::decode(octstr_secret, - octstr_secret.size()); - - key->PKCS8_load_hook(); - } - - EC_Key_Decoder(EC_PrivateKey* k): key(k) {} - private: - EC_PrivateKey* key; - }; - - return new EC_Key_Decoder(this); - } - void EC_PrivateKey::PKCS8_load_hook(bool) { public_key = domain().get_base_point() * private_key; |