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

XSECProvider Class Reference
[Main Signature API]

#include <XSECProvider.hpp>

Collaboration diagram for XSECProvider:

Collaboration graph
[legend]
List of all members.

Detailed Description

The main provider class for XML Digital Signatures and Encryption objects.

The XSECProvider class is used to create and destroy signature objects and encryption objects. It provides a number of methods to create signature and encryption objects for a variety of situations - in particular creating an empty signature or cipher with which to create the DOM structure or creating a security object based on an already existing DOM structure.


Public Member Functions

Constructors and Destructors
 XSECProvider ()
 Default constructor.
 ~XSECProvider ()
Signature Creation Classes
DSIGSignaturenewSignatureFromDOM (XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *sigNode)
 DSIGSignature creator for use with existing XML signatures or templates.
DSIGSignaturenewSignatureFromDOM (XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc)
 DSIGSignature creator for use with existing XML signatures or templates.
DSIGSignaturenewSignature (void)
 DSIGSignature creator for creating new XML signatures.
void releaseSignature (DSIGSignature *toRelease)
 Method for destroying DSIGSignature objects created via this provider.
Encryption Creation Functions
XENCCiphernewCipher (XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc)
 Create an XENCCipher object based on a particular DOM Document.
void releaseCipher (XENCCipher *toRelease)
 Method to delete XENCCipher objects created via this provider.
XKMS Functions
XKMSMessageFactorygetXKMSMessageFactory (void)
 Obtain a pointer to the XKMSMessageFactory.
Environmental Options
void setDefaultURIResolver (XSECURIResolver *resolver)
 Set the default URIResolver.


Constructor & Destructor Documentation

XSECProvider::XSECProvider  ) 
 

Default constructor.

The provider class requires no parameters for construction

XSECProvider::~XSECProvider  ) 
 


Member Function Documentation

XKMSMessageFactory* XSECProvider::getXKMSMessageFactory void   ) 
 

Obtain a pointer to the XKMSMessageFactory.

The XKMSMessageFactory is used to create and manipulate XKMS messages.

Note:
Unlike other objects created by the provider, only one XKMSMessageFactory is ever instantiated for a particular provider. Applications should never delete the Factory, as it is taken care of by the provider.

XENCCipher* XSECProvider::newCipher XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *  doc  ) 
 

Create an XENCCipher object based on a particular DOM Document.

XENCCipher is an engine class that is used to wrap encryption/decryption functions. Unlike the Signature functions, only a XENCCipher object attached to a particular document is required. Arbitrary objects within this document can then be encrypted/decrypted using this class.

Parameters:
doc Document to attach the XENCCipher to.
Returns:
An implementation object for XENCCipher

DSIGSignature* XSECProvider::newSignature void   ) 
 

DSIGSignature creator for creating new XML signatures.

Create an empty DSIGSignature object that can be used to create new signature values. The returned signature object needs to be initialised with a document so a blank signature DOM structure can be created

See also:
DSIGSignature::createBlankSignature

DSIGSignature* XSECProvider::newSignatureFromDOM XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *  doc  ) 
 

DSIGSignature creator for use with existing XML signatures or templates.

Create a DSIGSignature object based on an already existing DSIG Signature XML node. It is assumed that the underlying DOM structure is in place and works correctly.

In this case, the XML-Security libraries will find the signature node.

Note:
The library will only find and use the first signature node in the document. If there are more, they will not be validated
Parameters:
doc The DOM document node in which the signature is embedded.
See also:
DSIGSignature::load

DSIGSignature* XSECProvider::newSignatureFromDOM XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *  doc,
XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *  sigNode
 

DSIGSignature creator for use with existing XML signatures or templates.

Create a DSIGSignature object based on an already existing DSIG Signature XML node. It is assumed that the underlying DOM structure is in place and works correctly.

In this case, the caller can pass in the signature DOM Node for cases where there may be more than one signature in a document. The caller needs to specify which signature tree is to be used.

Parameters:
doc The DOM document node in which the signature is embedded.
sigNode The DOM node (within doc) that is to be used as the base of the signature.
See also:
DSIGSignature::load

void XSECProvider::releaseCipher XENCCipher toRelease  ) 
 

Method to delete XENCCipher objects created via this provider.

The provider keeps track of all objects by it. This method can be used to delete any previously created XENCCipher objects prior to the provider being deleted. Any XENCCipher objects not released using this function will automatically be deleted when the provider goes out of scope (or is itself deleted).

Parameters:
toRelease The XENCCipher object to be deleted

void XSECProvider::releaseSignature DSIGSignature toRelease  ) 
 

Method for destroying DSIGSignature objects created via this provider.

The provider keeps track of all signature objects created during the lifetime of the provider. This method can be called to delete a signature whilst the provider is still in scope. Otherwise the objects will be automatically deleted when the provider object goes out of scope.

In cases where the DSIGSignature has been used to create a new DOM structure, it can be safely deleted once the signature operations have been completed without impacting the underlying DOM structure.

Parameters:
toRelease The DSIGSignature object to be deleted.
Todo:
The DSIGSignature objects are fairly bulky in terms of creation and deletion. There should be a capability to store "released" objects in a re-use stack. At the moment the Provider class simply deletes the objects.
See also:
DSIGSignature::createBlankSignature

void XSECProvider::setDefaultURIResolver XSECURIResolver resolver  ) 
 

Set the default URIResolver.

DSIGSignature objects require a URIResolver to allow them to de-reference URIs in reference elements.

This function sets the resolver that will be used for all signatures created after this is set. The resolver is cloned, so the object passed in can be safely deleted once the function has been completed.


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