class Akenti::OpenSSLSignatureImpl

This class implements the digital signature interface defined in SignatureImpl by holding a ENV_MD_CTX object and wrapping the appropriate openssl functions.

Inheritance:


Public Methods

[more] OpenSSLSignatureImpl (const string& alg)
[more] ~OpenSSLSignatureImpl ()
[more]string getAlgorithm () const
Returns a string that identifies the algorithm, independent of implementation details.
[more]static bool isSignatureAlgorithmSupported (const string& alg)
[more]static const EVP_MD* getEVP_MD (const string& alg)

Protected Methods

[more]void resetEngine ()
Resets the digest engine
[more]void doUpdate (const string &data, int offset, int len)
Updates the data to be signed or verified.
[more]string doSign ()
Returns the digital signature of all the data that has been accumlated from update calls.
[more]bool doVerify (const string &signature)
Returns true if signature verifies, false otherwise.
[more]string paramString () const
Returns a string representation for OpenSSLSignatureImpl which is used for debugging purposes.


Inherited from SignatureImpl:

Public Methods

ovoid initSign(const PrivateKey& privKey)
ovoid initVerify(const PublicKey& pubKey)
ovoid update(const string& data)
ovoid update(const string& data, int offset, int len)
ostring sign()
ostring sign(const string& data)
ostring sign(const string& data, int offset, int len)
obool verify(const string& signature)


Documentation

This class implements the digital signature interface defined in SignatureImpl by holding a ENV_MD_CTX object and wrapping the appropriate openssl functions.

Typically the clients will not deal with an instance of this class directly. Instead they interact with the Signature reference-count pointer.

o OpenSSLSignatureImpl(const string& alg)

o ~OpenSSLSignatureImpl()

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

Returns:
name of the algorithm

ostatic bool isSignatureAlgorithmSupported(const string& alg)

ostatic const EVP_MD* getEVP_MD(const string& alg)

ovoid resetEngine()
Resets the digest engine

ovoid 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

ostring doSign()
Returns the digital signature of all the data that has been accumlated from update calls.

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

obool doVerify(const string &signature)
Returns true if signature verifies, false otherwise. All the data that has been accumulated by update calls is signed by the public key and the results are compared to the input signature. If they match verify is true.

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

ostring paramString() const
Returns a string representation for OpenSSLSignatureImpl which is used for debugging purposes.

Returns:
debugging info


This class has no child classes.
Author:
Srilekha Mudumbai Abdelilah Essiari
Version:
1.1 00/05/01
See Also:
SignatureImpl
Error
getProvider()
getSignature(const string&)

Alphabetic index HTML hierarchy of classes or Java



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