aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pk_pad/emsa.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/pk_pad/emsa.h')
-rw-r--r--src/lib/pk_pad/emsa.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/lib/pk_pad/emsa.h b/src/lib/pk_pad/emsa.h
index c2e352325..5a8f0daec 100644
--- a/src/lib/pk_pad/emsa.h
+++ b/src/lib/pk_pad/emsa.h
@@ -22,12 +22,28 @@ class RandomNumberGenerator;
*
* Any way of encoding/padding signatures
*/
-class EMSA
+class BOTAN_TEST_API EMSA
{
public:
virtual ~EMSA() = default;
/**
+ * Factory method for EMSA (message-encoding methods for signatures
+ * with appendix) objects
+ * @param algo_spec the name of the EMSA to create
+ * @return pointer to newly allocated object of that type, or nullptr
+ */
+ static std::unique_ptr<EMSA> create(const std::string& algo_spec);
+
+ /**
+ * Factory method for EMSA (message-encoding methods for signatures
+ * with appendix) objects
+ * @param algo_spec the name of the EMSA to create
+ * @return pointer to newly allocated object of that type, or throws
+ */
+ static std::unique_ptr<EMSA> create_or_throw(const std::string& algo_spec);
+
+ /**
* Add more data to the signature computation
* @param input some data
* @param length length of input in bytes
@@ -75,7 +91,7 @@ class EMSA
/**
* @return a new object representing the same encoding method as *this
*/
- virtual EMSA* clone() = 0;
+ virtual std::unique_ptr<EMSA> new_object() = 0;
/**
* @return the SCAN name of the encoding/padding scheme