aboutsummaryrefslogtreecommitdiffstats
path: root/src/pubkey
diff options
context:
space:
mode:
authorlloyd <[email protected]>2012-02-03 21:17:14 +0000
committerlloyd <[email protected]>2012-02-03 21:17:14 +0000
commit88626b546863966ba6cf100d68fb9d73bc2a9fb9 (patch)
tree706d0e7599673e73b87a97c810c8521d2e2d9d9b /src/pubkey
parentdd2011140c06661e1cc554aae560a2ef9162faff (diff)
Support ECDH key creation in the key factory function. Patch from Sean
Cassidy, sent to the mailing list.
Diffstat (limited to 'src/pubkey')
-rw-r--r--src/pubkey/pk_algs.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/pubkey/pk_algs.cpp b/src/pubkey/pk_algs.cpp
index e500cfc2e..9b3218ac4 100644
--- a/src/pubkey/pk_algs.cpp
+++ b/src/pubkey/pk_algs.cpp
@@ -40,6 +40,10 @@
#include <botan/elgamal.h>
#endif
+#if defined(BOTAN_HAS_ECDH)
+ #include <botan/ecdh.h>
+#endif
+
namespace Botan {
Public_Key* make_public_key(const AlgorithmIdentifier& alg_id,
@@ -89,6 +93,11 @@ Public_Key* make_public_key(const AlgorithmIdentifier& alg_id,
return new GOST_3410_PublicKey(alg_id, key_bits);
#endif
+#if defined(BOTAN_HAS_ECDH)
+ if(alg_name == "ECDH")
+ return new ECDH_PublicKey(alg_id, key_bits);
+#endif
+
return 0;
}
@@ -140,6 +149,11 @@ Private_Key* make_private_key(const AlgorithmIdentifier& alg_id,
return new GOST_3410_PrivateKey(alg_id, key_bits);
#endif
+#if defined(BOTAN_HAS_ECDH)
+ if(alg_name == "ECDH")
+ return new ECDH_PrivateKey(alg_id, key_bits);
+#endif
+
return 0;
}