aboutsummaryrefslogtreecommitdiffstats
path: root/src/pubkey/pubkey.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-03-05 01:09:28 +0000
committerlloyd <[email protected]>2010-03-05 01:09:28 +0000
commit1c7dbb21d19702872379421e6ae44a15caf67da2 (patch)
treebd4ee9e01f8cfd9631655d0e0b0991d49c0a7e8e /src/pubkey/pubkey.h
parent78b5b103291ee668185dc71d138a50e8e7e54808 (diff)
Add signature generation operation classes. Remove sign() from
PK_Signing_Key, though for the moment the class remains because there are a few pieces of code that use it to detect if signatures are supported, or for passing to functions in look_pk
Diffstat (limited to 'src/pubkey/pubkey.h')
-rw-r--r--src/pubkey/pubkey.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/pubkey/pubkey.h b/src/pubkey/pubkey.h
index 4d6490919..fc0e90fa8 100644
--- a/src/pubkey/pubkey.h
+++ b/src/pubkey/pubkey.h
@@ -112,13 +112,14 @@ class BOTAN_DLL PK_Signer
* @return the signature
*/
SecureVector<byte> sign_message(const MemoryRegion<byte>& in,
- RandomNumberGenerator& rng);
+ RandomNumberGenerator& rng)
+ { return sign_message(&in[0], in.size(), rng); }
/**
* Add a message part (single byte).
* @param the byte to add
*/
- void update(byte in);
+ void update(byte in) { update(&in, 1); }
/**
* Add a message part.
@@ -131,7 +132,7 @@ class BOTAN_DLL PK_Signer
* Add a message part.
* @param in the message part to add
*/
- void update(const MemoryRegion<byte>& in);
+ void update(const MemoryRegion<byte>& in) { update(&in[0], in.size()); }
/**
* Get the signature of the so far processed message (provided by the
@@ -145,7 +146,7 @@ class BOTAN_DLL PK_Signer
* Set the output format of the signature.
* @param format the signature format to use
*/
- void set_output_format(Signature_Format format);
+ void set_output_format(Signature_Format format) { sig_format = format; }
/**
* Construct a PK Signer.
@@ -153,16 +154,16 @@ class BOTAN_DLL PK_Signer
* @param emsa the EMSA to use
* An example would be "EMSA1(SHA-224)".
*/
- PK_Signer(const PK_Signing_Key& key, EMSA* emsa);
+ PK_Signer(const Private_Key& key, EMSA* emsa);
- ~PK_Signer() { delete emsa; }
+ ~PK_Signer() { delete op; delete emsa; }
private:
PK_Signer(const PK_Signer&);
PK_Signer& operator=(const PK_Signer&);
- const PK_Signing_Key& key;
- Signature_Format sig_format;
+ PK_Ops::Signature_Operation* op;
EMSA* emsa;
+ Signature_Format sig_format;
};
/**