class Akenti::SignatureImpl

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

Inheritance:


Public Methods

[more]virtual ~SignatureImpl ()
Deletes this object
[more]virtual string getAlgorithm () const
Returns a string that identifies the algorithm, independent of implementation details.
[more]void initSign (const PrivateKey& privKey)
Initializes this object for signing.
[more]void initVerify (const PublicKey& pubKey)
Initializes this object for verification.
[more]void update (const string& data)
Updates the data to be signed or verified.
[more]void update (const string& data, int offset, int len)
Updates the data to be signed or verified.
[more]string sign ()
Returns the digital signature of whatever data has been accumlated from the update calls.
[more]string sign (const string& data)
Returns the digital signature of whatever data has been accumlated from the update calls plus the input data.
[more]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.
[more]bool verify (const string& signature)
Returns true if signature verifies.

Protected Methods

[more] SignatureImpl ()
Constructs this object
[more]virtual void resetEngine ()
Resets the digest engine
[more]virtual void doUpdate (const string& data, int offset, int len)
Updates the data to be signed or verified.
[more]virtual string doSign ()
Returns the digital signature.
[more]virtual bool doVerify (const string& signature)
Returns true if signature verifies.
[more]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.

ovirtual ~SignatureImpl()
Deletes this object

ovirtual string getAlgorithm() const = 0
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

ovoid initSign(const PrivateKey& privKey)
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()

ovoid initVerify(const PublicKey& pubKey)
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()

ovoid 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)

ovoid 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)

ostring 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()

ostring 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()

ostring 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

obool 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&)

o SignatureImpl()
Constructs this object

ovirtual void resetEngine() = 0
Resets the digest engine

ovirtual void doUpdate(const string& data, int offset, int len) = 0
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

ovirtual string doSign() = 0
Returns the digital signature.

Throws:
Error if the private key is uninitialized
SecurityException if signature fails

ovirtual bool doVerify(const string& signature) = 0
Returns true if signature verifies. False otherwise.

Throws:
Error if the public key is uninitialized
Parameters:
signature - digital signature to be verified

ovirtual string paramString() const = 0
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 HTML hierarchy of classes or Java



This page was generated with the help of DOC++.