From 4bc4cc6390f55d1eed65fe0d6b5170b5e65ae058 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Wed, 2 Dec 2015 07:06:55 -0500 Subject: Add update overload taking std::string to PK_Verifier and PK_Signer Because convenient --- src/lib/pubkey/pubkey.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src') 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 @@ -180,6 +180,15 @@ class BOTAN_DLL PK_Signer */ void update(const std::vector& 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(in.data()), in.size()); + } + /** * Get the signature of the so far processed message (provided by the * calls to update()). @@ -264,6 +273,15 @@ class BOTAN_DLL PK_Verifier void update(const std::vector& in) { 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(in.data()), in.size()); + } + /** * Check the signature of the buffered message, i.e. the one build * by successive calls to update. -- cgit v1.2.3