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

XSECAlgorithmHandler Class Reference
[XML Encryption Implementation]

#include <XSECAlgorithmHandler.hpp>

List of all members.


Detailed Description

Interface class to provide handlers for processing different encryption types.

The XENCCipher class allows users and callers to register algorithm handlers for different Type URIs, as defined in the EncryptionMethod element within XML Encryption.

A default handler (XENCAlgorithmHandlerDefault) is provided by the library, and is used to process all algorithms defined as mandatory (and many optional) within the standard.

Users can extend this class to provide custom algorithm handlers for their own classes.

Note:
The library will use a single clone of any provided object for a given algorithm. So all implementation classes must be thread safe!


Public Member Functions

Constructors and Destructors
virtual ~XSECAlgorithmHandler ()
Encryption Methods
virtual bool encryptToSafeBuffer (TXFMChain *plainText, XENCEncryptionMethod *encryptionMethod, XSECCryptoKey *key, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, safeBuffer &result)=0
 Encrypt an input Transform chain to a safeBuffer.
Decryption Methods
virtual unsigned int decryptToSafeBuffer (TXFMChain *cipherText, XENCEncryptionMethod *encryptionMethod, XSECCryptoKey *key, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, safeBuffer &result)=0
 Decrypt an input Transform chain to a safeBuffer.
virtual bool appendDecryptCipherTXFM (TXFMChain *cipherText, XENCEncryptionMethod *encryptionMethod, XSECCryptoKey *key, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc)=0
 Append an appropriate decrypt TXFMer to a cipher txfm chain.
Key handling
virtual XSECCryptoKeycreateKeyForURI (const XMLCh *uri, unsigned char *keyBuffer, unsigned int keyLen)=0
 Create a key that will support a given URI.
Miscellaneous Functions
virtual XSECAlgorithmHandlerclone (void) const =0
 Create a new instance of the handler.


Constructor & Destructor Documentation

virtual XSECAlgorithmHandler::~XSECAlgorithmHandler  )  [inline, virtual]
 


Member Function Documentation

virtual bool XSECAlgorithmHandler::appendDecryptCipherTXFM TXFMChain cipherText,
XENCEncryptionMethod encryptionMethod,
XSECCryptoKey key,
XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *  doc
[pure virtual]
 

Append an appropriate decrypt TXFMer to a cipher txfm chain.

This method takes a TXFMChain that will provide the cipher text data, and appends the appropriate cipher transformer to decrypt the output.

The EncryptionMethod object is provided so that any algorithm specific parameters can be found by the processor. It also allows applications to embed multiple algorithms in a single processing object. The Type value can then be read from the EncryptionMethod object to determine what to do.

Parameters:
cipherText Chain that will provide the cipherText. Ownership remains with the caller - do not delete.
encryptionMethod Information about the algorithm to use
key The key that has been determined via a resolver or that has been provided by the calling application.
doc Document from which to create XML Nodes
Returns:
The resulting BinInputStream

virtual XSECAlgorithmHandler* XSECAlgorithmHandler::clone void   )  const [pure virtual]
 

Create a new instance of the handler.

Provides a means for the library to create a new instance of the object without knowing its type

virtual XSECCryptoKey* XSECAlgorithmHandler::createKeyForURI const XMLCh *  uri,
unsigned char *  keyBuffer,
unsigned int  keyLen
[pure virtual]
 

Create a key that will support a given URI.

Given a URI string and a raw bit string, create the associated key

Parameters:
uri URI string to match key to
keyBuffer Raw bits to set in the key
keyLen Number of bytes in the key

virtual unsigned int XSECAlgorithmHandler::decryptToSafeBuffer TXFMChain cipherText,
XENCEncryptionMethod encryptionMethod,
XSECCryptoKey key,
XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *  doc,
safeBuffer result
[pure virtual]
 

Decrypt an input Transform chain to a safeBuffer.

This method takes a TXFMChain that will provide the cipher text data, and places the output in a safeBuffer.

The EncryptionMethod object is provided so that any algorithm specific parameters can be found by the processor. It also allows applications to embed multiple algorithms in a single processing object. The Type value can then be read from the EncryptionMethod object to determine what to do.

Parameters:
cipherText Chain that will provide the cipherText. Ownership remains with the caller - do not delete.
encryptionMethod Information about the algorithm to use
key The key that has been determined via a resolver or that has been provided by the calling application.
doc Document in which to operate
result SafeBuffer object to place result into
Returns:
The number of plain bytes placed in the safeBuffer

virtual bool XSECAlgorithmHandler::encryptToSafeBuffer TXFMChain plainText,
XENCEncryptionMethod encryptionMethod,
XSECCryptoKey key,
XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *  doc,
safeBuffer result
[pure virtual]
 

Encrypt an input Transform chain to a safeBuffer.

This method takes a TXFMChain that will provide the plain text data, and places the encrypted and base64 encoded output in a safeBuffer.

The EncryptionMethod object is provided so that any algorithm specific parameters can be embedded by the processor. Default parameters can be set directly (OAEParams and KeySize). Anything additional will need to be set within the DOM directly.

Parameters:
plainText Chain that will provide the plain bytes. Ownership remains with the caller - do not delete.
encryptionMethod Information about the algorithm to use. Can also be used to set the required encryption parameters
key The key that has been provided by the calling application to perform the encryption.
doc Document in which to operate
result SafeBuffer object to place result into
Note:
This is not quite the symmetric opposite of decryptToSafeBuffer because of the way the library uses transformers. It is expected that this method will create a safeBuffer with base64 encoded data. (It's easier to throw a TXFMBase64 txfmer on the end of the chain than to do the encryption and then separately base64 encode.)


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