aboutsummaryrefslogtreecommitdiffstats
path: root/src/engine/def_engine/def_pk_ops.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/def_engine/def_pk_ops.cpp')
-rw-r--r--src/engine/def_engine/def_pk_ops.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/engine/def_engine/def_pk_ops.cpp b/src/engine/def_engine/def_pk_ops.cpp
index d1ee454a2..57d17f662 100644
--- a/src/engine/def_engine/def_pk_ops.cpp
+++ b/src/engine/def_engine/def_pk_ops.cpp
@@ -114,6 +114,43 @@ Default_Engine::get_signature_op(const Private_Key& key) const
return 0;
}
+PK_Ops::Verification*
+Default_Engine::get_verify_op(const Public_Key& key) const
+ {
+#if defined(BOTAN_HAS_RSA)
+ if(const RSA_PublicKey* s = dynamic_cast<const RSA_PublicKey*>(&key))
+ return new RSA_Verification_Operation(*s);
+#endif
+
+#if defined(BOTAN_HAS_RW)
+ if(const RW_PublicKey* s = dynamic_cast<const RW_PublicKey*>(&key))
+ return new RW_Verification_Operation(*s);
+#endif
+
+#if defined(BOTAN_HAS_DSA)
+ if(const DSA_PublicKey* s = dynamic_cast<const DSA_PublicKey*>(&key))
+ return new DSA_Verification_Operation(*s);
+#endif
+
+#if defined(BOTAN_HAS_ECDSA)
+ if(const ECDSA_PublicKey* s = dynamic_cast<const ECDSA_PublicKey*>(&key))
+ return new ECDSA_Verification_Operation(*s);
+#endif
+
+#if defined(BOTAN_HAS_GOST_3410_2001)
+ if(const GOST_3410_PublicKey* s =
+ dynamic_cast<const GOST_3410_PublicKey*>(&key))
+ return new GOST_3410_Verification_Operation(*s);
+#endif
+
+#if defined(BOTAN_HAS_NYBERG_RUEPPEL)
+ if(const NR_PublicKey* s = dynamic_cast<const NR_PublicKey*>(&key))
+ return new NR_Verification_Operation(*s);
+#endif
+
+ return 0;
+ }
+
#if defined(BOTAN_HAS_IF_PUBLIC_KEY_FAMILY)
/*
* Acquire an IF op