namespace Akenti class SignatureImpl

This abstract class provides applications with the interface of a digital signature algorithm such as RSA-MD5 or DSA-SHA1

Inheritance:


Public Methods

virtual ~SignatureImpl ()
Deletes this object
virtual string getAlgorithm () const
Returns a string that identifies the algorithm, independent of implementation details
void initSign (const PrivateKey& privateKey)
Initializes this object for signing
void initVerify (const PublicKey& publicKey)
Initializes this object for verification
void update (const string& data)
Updates the data to be signed or verified
void update (const string& data, int offset, int len)
Updates the data to be signed or verified
string sign ()
Returns the digital signature of whatever data has been accumlated from the update calls
string sign (const string& data)
Returns the digital signature of whatever data has been accumlated from the update calls plus the input data
string sign (const string& data, int offset, int len)
Returns the digital signature of whatever data has been accumlated from the update calls plus the input data
bool verify (const string& signature)
Returns true if signature verifies

Protected Methods

SignatureImpl ()
Constructs this object
virtual void resetEngine ()
Resets the digest engine
virtual void doUpdate (const string& data, int offset, int len)
Updates the data to be signed or verified
virtual string doSign ()
Returns the digital signature
virtual bool doVerify (const string& signature)
Returns true if signature verifies
virtual string paramString () const
Returns a string representation for SignatureImpl which is used for debugging purposes

Documentation

This abstract class provides applications with the interface of a digital signature algorithm such as RSA-MD5 or DSA-SHA1. It also provides some of the functionality. The rest of the functionality is to be provided by the subclass implementors. Typically the clients will not deal with an instance of this class directly. Instead they interact with the Signature reference-count pointer.

A SignatureImpl object is initialized by calling either the intSign if we are signing or the initVerify method if we are verifying. The data is processed through it using the update methods. Once all the data has been updated, one of the sign methods will be should be called to compute the signature, or the verify method should be called to verify a signature.

virtual ~SignatureImpl()
Deletes this object

virtual string getAlgorithm() const
Returns a string that identifies the algorithm, independent of implementation details. The name should be a standard name such as "RSA-MD5".
Returns:
name of the algorithm

void initSign(const PrivateKey& privateKey)
Initializes this object for signing. If this method is called again with a different argument, it negates the effect of this call.
Parameters:
privateKey - the private key of the identity whose signature is going to be generated
See Also:
resetEngine()

void initVerify(const PublicKey& publicKey)
Initializes this object for verification. If this method is called again with a different argument, it negates the effect of this call.
Parameters:
publicKey - the public key of the identity whose signature is going to be verified
See Also:
resetEngine()

void update(const string& data)
Updates the data to be signed or verified.
Parameters:
data - the string of bytes to use for the update.
See Also:
doUpdate(const string&, int, int)

void update(const string& data, int offset, int len)
Updates the data to be signed or verified.
Throws:
Error if input buffer is too short
Parameters:
data - the string of bytes to use for the update
offset - start index
len - the number of bytes to use starting at offset
See Also:
doUpdate(const string&, int, int)

string sign()
Returns the digital signature of whatever data has been accumlated from the update calls.
Throws:
Error if initSign has not been called or if the private key is uninitialized
SecurityException if signature fails
See Also:
doSign()

string sign(const string& data)
Returns the digital signature of whatever data has been accumlated from the update calls plus the input data.
Throws:
Error if initSign has not been called or if the private key is uninitialized
SecurityException if signature fails
Parameters:
data - string of bytes to use for update
See Also:
doUpdate(const string&, int, int)
sign()

string sign(const string& data, int offset, int len)
Returns the digital signature of whatever data has been accumlated from the update calls plus the input data.
Throws:
Error if initSign has not been called or if the private key is uninitialized
SecurityException if signature fails
Parameters:
string - & data string of bytes to use for update
int - offset into string of data to use
int - len number of bytes of data to use in update call

bool verify(const string& signature)
Returns true if signature verifies. False otherwise.
Throws:
Error if initVerify has not been called or if the public key is uninitialized
Parameters:
signature - digital signature to be verified
See Also:
doVerify(const string&)

SignatureImpl()
Constructs this object

virtual void resetEngine()
Resets the digest engine

virtual void doUpdate(const string& data, int offset, int len)
Updates the data to be signed or verified.
Parameters:
data - the string of bytes to use for the update
offset - start index
len - the number of bytes to use starting at offset

virtual string doSign()
Returns the digital signature.
Throws:
Error if the private key is uninitialized
SecurityException if signature fails

virtual bool doVerify(const string& signature)
Returns true if signature verifies. False otherwise.
Throws:
Error if the public key is uninitialized
Parameters:
signature - digital signature to be verified

virtual string paramString() const
Returns a string representation for SignatureImpl which is used for debugging purposes.
Returns:
debugging info


Direct child classes:
OpenSSLSignatureImpl
Author:
Srilekha Mudumbai Abdelilah Essiari
Version:
1.1 00/05/01
See Also:
Signature
Error
getProvider()
getSignature(const string&)

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de