#include <DSIGReference.hpp>
Collaboration diagram for DSIGReference:
The DSIGReference class creates and manipulates (including hashing and validating) <Reference> elements.
Public Member Functions | |
Constructors and Destructors | |
DSIGReference (const XSECEnv *env, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *dom) | |
Contructor for use with existing XML signatures or templates. | |
DSIGReference (const XSECEnv *env) | |
Contructor for use when creating new Reference structures. | |
~DSIGReference () | |
Destructor. | |
Reference Construction and Manipulation | |
void | load () |
Load a DSIGReference from an existing DOM structure. | |
XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * | createBlankReference (const XMLCh *URI, hashMethod hm, char *type) |
Create a Reference structure in the document. | |
DSIGTransformEnvelope * | appendEnvelopedSignatureTransform () |
Append an Enveloped Signature Transform to the Reference. | |
DSIGTransformBase64 * | appendBase64Transform () |
Append a Base64 Transform to the Reference. | |
DSIGTransformXPath * | appendXPathTransform (const char *expr) |
Append an XPath Transform to the Reference. | |
DSIGTransformXPathFilter * | appendXPathFilterTransform (void) |
Append an XPath-Filter2 Transform to the Reference. | |
DSIGTransformXSL * | appendXSLTransform (XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *stylesheet) |
Append an XSLT Transform to the Reference. | |
DSIGTransformC14n * | appendCanonicalizationTransform (canonicalizationMethod cm) |
Append a Canonicalization Transform to the Reference. | |
void | setPreHashTXFM (TXFMBase *t) |
Append a "debug" transformer. | |
Getting Information | |
XSECBinTXFMInputStream * | makeBinInputStream (void) const |
Create an input stream based on the digested byte stream. | |
const XMLCh * | getURI () |
Return the URI string of the Reference. | |
hashMethod | getHashMethod (void) |
Get the Digest method. | |
DSIGTransformList * | getTransforms (void) |
Obtain the transforms for this reference. | |
bool | isManifest () |
Determine whether the reference is a manifest. | |
DSIGReferenceList * | getManifestReferenceList () |
Get the Manifest. | |
Message Digest/Hash manipulation | |
unsigned int | calculateHash (XMLByte *toFill, unsigned int maxToFill) |
Calculate the Hash value of a reference. | |
unsigned int | readHash (XMLByte *toFill, unsigned int maxToFill) |
Read the hash from the Reference element. | |
bool | checkHash () |
Validate the Reference element. | |
void | setHash () |
Set the value of the hash in the Reference. | |
Static Public Member Functions | |
Helper (static) Functions | |
static TXFMChain * | createTXFMChainFromList (TXFMBase *input, DSIGTransformList *lst) |
Create a Transformer chain. | |
static DSIGTransformList * | loadTransforms (XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *transformsNode, XSECSafeBufferFormatter *formatter, const XSECEnv *env) |
Load a Transforms list from the <Transforms> DOMNode. | |
static TXFMBase * | getURIBaseTXFM (XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, const XMLCh *URI, const XSECEnv *env) |
Create a starting point for a TXFM Chain. | |
static DSIGReferenceList * | loadReferenceListFromXML (const XSECEnv *env, XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *firstReference) |
Load a series of references. | |
static bool | verifyReferenceList (DSIGReferenceList *lst, safeBuffer &errorStr) |
Validate a list of references. | |
static void | hashReferenceList (DSIGReferenceList *list, bool interlocking=true) |
Hash a reference list. |
|
Contructor for use with existing XML signatures or templates. Create a DSIGReference object based on an already existing DSIG Reference XML node. It is assumed that the underlying DOM structure is in place and works correctly.
|
|
Contructor for use when creating new Reference structures. Create a DSIGReference object that can later be used to create a new Reference structure in the DOM document.
|
|
Destructor.
|
|
Append a Base64 Transform to the Reference.
|
|
Append a Canonicalization Transform to the Reference.
|
|
Append an Enveloped Signature Transform to the Reference. Appends a simple enveloped-signature transform to the list of transforms in this element.
|
|
Append an XPath-Filter2 Transform to the Reference. The returned DSIGTransformXPathFilter will have no actual filter expressions loaded, but calls can be made to DSIGTransformXPathFilter::appendTransform to add them.
|
|
Append an XPath Transform to the Reference. Append an XPath transform. Namespaces can be added to the transform directly using the returned DSIGTransformXPath structure
|
|
Append an XSLT Transform to the Reference. The caller must have already create the stylesheet and turned it into a DOM structure that is passed in as the stylesheet parameter.
|
|
Calculate the Hash value of a reference. Takes the Reference URI, performs all the transforms and finally calculates the Hash value of the data using the Digest algorithm indicated in the reference
|
|
Validate the Reference element. Performs a calculateHash() and a readHash() and then compares the results.
|
|
Create a Reference structure in the document. This function will create a Reference structure in the owner document. In some cases, a call to this function will be sufficient to put the required Reference in place. In other cases, calls will also need to be made to the various append*Transform methods.
|
|
Create a Transformer chain. Given a TransformList create the corresponding TXFM chain to allow the caller to read the reference byte stream
|
|
Get the Digest method. Obtain the digest method used to find a hash for this reference
|
|
Get the Manifest.
|
|
Obtain the transforms for this reference. Get the DSIGTransformList object for this reference. Can be used to obtain information about the transforms and also change the the transforms |
|
Return the URI string of the Reference.
|
|
Create a starting point for a TXFM Chain. Uses the provided URI to find the base data that the Transformer chain will be built upon.
|
|
Hash a reference list. Run through a list of references and calculate the hash value of each element. Finally set the Base64 encoded string according to the newly calcuated hash.
|
|
Determine whether the reference is a manifest.
|
|
Load a DSIGReference from an existing DOM structure. This function will load a Reference structure from the owner document. |
|
Load a series of references. Takes a series of <Reference> elements in a DOM structure and creates the corresponding ReferenceList object.
|
|
Load a Transforms list from the <Transforms> DOMNode. Reads the data from the XML data stored in the DOM and create the associated DSIGTrasnformList.
|
|
Create an input stream based on the digested byte stream. This method allows applications to read the fully canonicalised byte stream that is hashed for a reference. All transforms are performed up to the point where they would normally be fed into the Digest function.
|
|
Read the hash from the Reference element. Reads the Base64 encoded element from the Reference element. The hash is then translated from Base64 back into raw form and written into the indicated buffer.
|
|
Set the value of the hash in the Reference. Hashes the data referenced by the element and then writes the Base64 encoded hash value into the Reference. |
|
Append a "debug" transformer. This method allows applications to provide a TXFM that will be appended to the transform chain just prior to the application of the hash algorithm.
|
|
Validate a list of references. Runs through a reference list, calling verify() on each and setting the ErrroStrings for any errors found
|