aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pubkey
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2015-12-02 07:06:55 -0500
committerJack Lloyd <[email protected]>2015-12-02 07:06:55 -0500
commit4bc4cc6390f55d1eed65fe0d6b5170b5e65ae058 (patch)
treeffcced8e6da756f88e6e04af8745e50ff28d636d /src/lib/pubkey
parentdf64cbd15097321c51582cf0a11af0f6121b0dd4 (diff)
Add update overload taking std::string to PK_Verifier and PK_Signer
Because convenient
Diffstat (limited to 'src/lib/pubkey')
-rw-r--r--src/lib/pubkey/pubkey.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/lib/pubkey/pubkey.h b/src/lib/pubkey/pubkey.h
index 67116a9ec..637e522e4 100644
--- a/src/lib/pubkey/pubkey.h
+++ b/src/lib/pubkey/pubkey.h
@@ -134,7 +134,7 @@ class BOTAN_DLL PK_Signer
const std::string& provider = "");
/**
- * Sign a message.
+ * Sign a message all in one go
* @param in the message to sign as a byte array
* @param length the length of the above byte array
* @param rng the rng to use
@@ -181,6 +181,15 @@ class BOTAN_DLL PK_Signer
void update(const std::vector<byte>& in) { update(in.data(), in.size()); }
/**
+ * Add a message part.
+ * @param in the message part to add
+ */
+ void update(const std::string& in)
+ {
+ update(reinterpret_cast<const byte*>(in.data()), in.size());
+ }
+
+ /**
* Get the signature of the so far processed message (provided by the
* calls to update()).
* @param rng the rng to use
@@ -265,6 +274,15 @@ class BOTAN_DLL PK_Verifier
{ update(in.data(), in.size()); }
/**
+ * Add a message part of the message corresponding to the
+ * signature to be verified.
+ */
+ void update(const std::string& in)
+ {
+ update(reinterpret_cast<const byte*>(in.data()), in.size());
+ }
+
+ /**
* Check the signature of the buffered message, i.e. the one build
* by successive calls to update.
* @param sig the signature to be verified as a byte array