namespace Akenti class OpenSSLSignatureImpl : public SignatureImpl

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

OpenSSLSecureSocketImpl (const SSLContext& ctx)
Constructor - takes a security context, duplicates it and saves it in the new OpenSSLSecureSocketImpl
~OpenSSLSecureSocketImpl ()
Destructor - free the SSL structure and destroys this object
SecureSocketImpl* newInstance (const SSLContext& ctx)
Creates a new SecureSocketImpl
void doConnect ()
Provides the SocketImpl with a secure socket (an SSL structure containing a connected Unix socket) that has been connected to the host and port associated with the SocketImpl
void doAccept (SecureSocketImpl *impl)
OpenSSLSignatureImpl (const string& alg)
~OpenSSLSignatureImpl ()
string getAlgorithm () const
Returns a string that identifies the algorithm, independent of implementation details
static bool isSignatureAlgorithmSupported (const string& alg)
static const EVP_MD* getEVP_MD (const string& alg)

Protected Methods

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

Inherited from SignatureImpl:

Public Methods

void initSign(const PrivateKey& privKey)
void initVerify(const PublicKey& pubKey)
void update(const string& data)
void update(const string& data, int offset, int len)
string sign()
string sign(const string& data)
string sign(const string& data, int offset, int len)
bool 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.
OpenSSLSecureSocketImpl(const SSLContext& ctx)
Constructor - takes a security context, duplicates it and saves it in the new OpenSSLSecureSocketImpl.
Throws:
Error don't recognize the SSLContext
Error allocation failed
Parameters:
SSLContext - & ctx - a security context

~OpenSSLSecureSocketImpl()
Destructor - free the SSL structure and destroys this object

SecureSocketImpl* newInstance(const SSLContext& ctx)
Creates a new SecureSocketImpl. This interface is also defined in the superclass, SecureSocketImpl so that an application can create a new SocketImpl without knowing what kind it has.
Throws:
Error don't recognize the SSLContext
Error allocation failed
Parameters:
SSLContext - & ctx - a security context

void doConnect()
Provides the SocketImpl with a secure socket (an SSL structure containing a connected Unix socket) that has been connected to the host and port associated with the SocketImpl. The IOHandler for the connected fd is kept in the SocketImpl.
Throws:
SecurityException if the connection fails

void doAccept(SecureSocketImpl *impl)
Throws:
SecurityException if the handshake fails

OpenSSLSignatureImpl(const string& alg)

~OpenSSLSignatureImpl()

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" or "DSA-SHA1"
Returns:
name of the algorithm

static bool isSignatureAlgorithmSupported(const string& alg)

static const EVP_MD* getEVP_MD(const string& alg)

void resetEngine()
Resets the digest engine

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

string 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

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

string 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 hierarchy of classes


this page has been generated automatically by doc++

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