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

DSIGAlgorithmHandlerDefault Class Reference

#include <DSIGAlgorithmHandlerDefault.hpp>

Inheritance diagram for DSIGAlgorithmHandlerDefault:

Inheritance graph
[legend]
Collaboration diagram for DSIGAlgorithmHandlerDefault:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual ~DSIGAlgorithmHandlerDefault ()
virtual XSECAlgorithmHandlerclone (void) const
 Create a new instance of the handler.
virtual bool appendSignatureHashTxfm (TXFMChain *inputBytes, const XMLCh *URI, XSECCryptoKey *key)
 Append a signature hash to a TXFM Chain based on URI.
virtual unsigned int signToSafeBuffer (TXFMChain *inputBytes, const XMLCh *URI, XSECCryptoKey *key, unsigned int outputLength, safeBuffer &result)
 Sign an input TXFMChain.
virtual bool verifyBase64Signature (TXFMChain *inputBytes, const XMLCh *URI, const char *sig, unsigned int outputLength, XSECCryptoKey *key)
 Validate a signature using an input TXFMChain.
virtual bool appendHashTxfm (TXFMChain *inputBytes, const XMLCh *URI)
 Append a hash to a TXFM Chain based on URI.
virtual unsigned int decryptToSafeBuffer (TXFMChain *cipherText, XENCEncryptionMethod *encryptionMethod, XSECCryptoKey *key, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, safeBuffer &result)
 Decrypt an input Transform chain to a safeBuffer.
virtual bool appendDecryptCipherTXFM (TXFMChain *cipherText, XENCEncryptionMethod *encryptionMethod, XSECCryptoKey *key, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc)
 Append an appropriate decrypt TXFMer to a cipher txfm chain.
virtual bool encryptToSafeBuffer (TXFMChain *plainText, XENCEncryptionMethod *encryptionMethod, XSECCryptoKey *key, XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, safeBuffer &result)
 Encrypt an input Transform chain to a safeBuffer.
virtual XSECCryptoKeycreateKeyForURI (const XMLCh *uri, const unsigned char *keyBuffer, unsigned int keyLen)
 Create a key that will support a given URI.

Constructor & Destructor Documentation

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


Member Function Documentation

virtual bool DSIGAlgorithmHandlerDefault::appendDecryptCipherTXFM TXFMChain cipherText,
XENCEncryptionMethod encryptionMethod,
XSECCryptoKey key,
XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *  doc
[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

Implements XSECAlgorithmHandler.

virtual bool DSIGAlgorithmHandlerDefault::appendHashTxfm TXFMChain inputBytes,
const XMLCh *  URI
[virtual]
 

Append a hash to a TXFM Chain based on URI.

Given a URI string create the appropriate hash TXFM. NOTE the input URI should be a "stright" (i.e. non-signature) hash algorithm URI - e.g. #sha1

Parameters:
inputBytes the Input TXFMChain to append the hash to
uri URI string to match hash against
Returns:
true if a match was found and a hash was appended

Implements XSECAlgorithmHandler.

virtual bool DSIGAlgorithmHandlerDefault::appendSignatureHashTxfm TXFMChain inputBytes,
const XMLCh *  URI,
XSECCryptoKey key
[virtual]
 

Append a signature hash to a TXFM Chain based on URI.

Given a URI string create the appropriate hash TXFM. NOTE the input URI should be a SIGNATURE URI - e.g. #hash-sha1

Parameters:
inputBytes the Input TXFMChain to append the hash to
uri URI string to match hash against
key The key for this signature (in case of an HMAC hash)
Returns:
true if a match was found and a hash was appended

Implements XSECAlgorithmHandler.

virtual XSECAlgorithmHandler* DSIGAlgorithmHandlerDefault::clone void   )  const [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

Implements XSECAlgorithmHandler.

virtual XSECCryptoKey* DSIGAlgorithmHandlerDefault::createKeyForURI const XMLCh *  uri,
const unsigned char *  keyBuffer,
unsigned int  keyLen
[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

Implements XSECAlgorithmHandler.

virtual unsigned int DSIGAlgorithmHandlerDefault::decryptToSafeBuffer TXFMChain cipherText,
XENCEncryptionMethod encryptionMethod,
XSECCryptoKey key,
XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *  doc,
safeBuffer result
[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

Implements XSECAlgorithmHandler.

virtual bool DSIGAlgorithmHandlerDefault::encryptToSafeBuffer TXFMChain plainText,
XENCEncryptionMethod encryptionMethod,
XSECCryptoKey key,
XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *  doc,
safeBuffer result
[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.)

Implements XSECAlgorithmHandler.

virtual unsigned int DSIGAlgorithmHandlerDefault::signToSafeBuffer TXFMChain inputBytes,
const XMLCh *  URI,
XSECCryptoKey key,
unsigned int  outputLength,
safeBuffer result
[virtual]
 

Sign an input TXFMChain.

This method takes a TXFMChain that will provide the plain text data, and places a (null terminated) base64 encoded hash into a result safeBuffer.

Unlike the encryption methods, the URI must also be passed in, as a single AlgorithmHandler might be used to support multiple different signing algorithms, but the overhead of passing in the entire SignedInfo is not required.

Parameters:
plainText Chain that will provide the plain bytes. Ownership remains with the caller - do not delete.
URI Algorithm URI to use for the signing operation.
key The key that has been provided by the calling application to perform the signature.
outputLength Max length of an HMAC signature to use in output
result SafeBuffer object to place result into
Returns:
the number of bytes placed in the output safeBuffer

Implements XSECAlgorithmHandler.

virtual bool DSIGAlgorithmHandlerDefault::verifyBase64Signature TXFMChain inputBytes,
const XMLCh *  URI,
const char *  sig,
unsigned int  outputLength,
XSECCryptoKey key
[virtual]
 

Validate a signature using an input TXFMChain.

Using the input plain text bytes (in the form of a transform chain) validate the associated base64 encoded signature using the supplied key.

The URI value is used to determine the algorithm to be called upon to validate the signature.

Parameters:
plainText Chain that will provide the plain bytes. Ownership remains with the caller - do not delete.
URI Algorithm URI to use for the signing operation.
sig Base64 encoded signature value
key The key that has been provided by the calling application to perform the signature.
Returns:
true if successful validate, false otherwise

Implements XSECAlgorithmHandler.


The documentation for this class was generated from the following file:
Generated on Sun Jan 28 19:43:32 2007 for XML-Security-C by  doxygen 1.4.2