Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

XSECPlatformUtils Class Reference
[Internal Classes]

#include <XSECPlatformUtils.hpp>

Collaboration diagram for XSECPlatformUtils:

Collaboration graph
[legend]
List of all members.

Detailed Description

High level library interface class.

This class is used primarily to initialise the library and communicate high level parameters that will be common to all objects from the class in any given session.

It is primarily a static class.


Static Public Member Functions

static void Initialise (XSECCryptoProvider *p=NULL)
 Initialise the library.
static void SetCryptoProvider (XSECCryptoProvider *p)
 Set a new crypto provider.
static void registerAlgorithmHandler (const XMLCh *uri, const XSECAlgorithmHandler &handler)
 Add a new algorithm Handler.
static void Terminate (void)
 Terminate.

Static Public Attributes

static int initCount
 Number of times initialise has been called.
static XSECCryptoProviderg_cryptoProvider
 The main cryptographic provider.
static const XSECAlgorithmMapperg_algorithmMapper
 The global Algorithm Mapper.


Member Function Documentation

static void XSECPlatformUtils::Initialise XSECCryptoProvider p = NULL  )  [static]
 

Initialise the library.

Must be called prior to using any functions in the library.

Primarily sets up static variables used by all classes in the library.

Parameters:
p A pointer to a XSECCryptoProvider object that the library should use for cryptographic functions. If p == NULL, the library will instantiate an OpenSSLCryptoProvider object.

static void XSECPlatformUtils::registerAlgorithmHandler const XMLCh *  uri,
const XSECAlgorithmHandler handler
[static]
 

Add a new algorithm Handler.

Application developers can extend the XSECAlgorithmHandler class to implement new cryptographic algorithms. This will then allow the library to call the provided handler whenever trying to process a type it doesn't understand.

Any handler previously registered for this URI will be overwritten, allowing callers to overwrite the handlers for default URIs.

See also:
XSECAlgorithmHandler
Note:
This is not thread safe. Algorithm handlers should be added prior to any processing of signatures etc.
Parameters:
uri Type URI that maps to this handler
handler The handler to be used whenever this URI is seen by the library.

static void XSECPlatformUtils::SetCryptoProvider XSECCryptoProvider p  )  [static]
 

Set a new crypto provider.

Set the crypto provider to the value passed in. Any current provider is deleted.

Note:
This is not thread-safe. It should be called prior to any real usage of the library.
Parameters:
p A pointer to a XSECCryptoProvider object that the library should use for cryptographic functions.
Note:
Ownership of the provider is passed to the library, which will delete it at Termination.

static void XSECPlatformUtils::Terminate void   )  [static]
 

Terminate.

Should be called prior to any program exist to allow the library to cleanly delete any memory associated with the library as a whole.

Note:
Do not call this function while any xml-security-c object remain instantiated. The results of doing so is undefined, and could cause bad results.


Member Data Documentation

const XSECAlgorithmMapper* XSECPlatformUtils::g_algorithmMapper [static]
 

The global Algorithm Mapper.

The algorithm mapper is used to map algorithm type URI strings to algorithm implementations. Note that this is a level of indirection above actual cryptographic algorithms. For example:

URI = http://www.w3.org/2001/04/xmlenc#tripledes-cbc

is the URI for 3DES in CBC mode. The mapper will return an algorithm handler that understands what this means in terms of IVs and how to call the XSECCryptoKey interface. It then uses the cryptographic provider to actually perform the encryption.

This allows applications to provide new algorithm types. The mapper is used to map the type string to the means of doing the encryption, and a new XSECCryptoKey derivative can be provided to perform the actual crypo work.

Note:
The provider should only be added to via the XSECPlatformUtils::addAlgorithmHandler() call.
See also:
#addAlgorithmHandler()

XSECCryptoProvider* XSECPlatformUtils::g_cryptoProvider [static]
 

The main cryptographic provider.

This pointer can be used to determine the primary crypto provider registered in the library.

Individual signatures can over-ride this default.

int XSECPlatformUtils::initCount [static]
 

Number of times initialise has been called.

initCount can be read by any class or function to determine how many times the library has been initialised.


The documentation for this class was generated from the following file:
Generated on Sun Jul 3 17:45:50 2005 for XML-Security-C by  doxygen 1.4.2