#include <DSIGReference.hpp>
Collaboration diagram for DSIGReference:
Public Methods | |
Constructors and Destructors | |
DSIGReference (DSIGSignature *sig, DOMNode *dom) | |
Contructor for use with existing XML signatures or templates. More... | |
DSIGReference (DSIGSignature *sig) | |
Contructor for use when creating new Reference structures. More... | |
~DSIGReference () | |
Destructor. More... | |
Reference Construction and Manipulation | |
void | load () |
Load a DSIGReference from an existing DOM structure. More... | |
DOMElement * | createBlankReference (char *URI, hashMethod hm, char *type) |
Create a Reference structure in the document. More... | |
DSIGTransformEnvelope * | appendEnvelopedSignatureTransform () |
Append an Enveloped Signature Transform to the Reference. More... | |
DSIGTransformBase64 * | appendBase64Transform () |
Append a Base64 Transform to the Reference. More... | |
DSIGTransformXPath * | appendXPathTransform (char *expr) |
Append an XPath Transform to the Reference. More... | |
DSIGTransformXSL * | appendXSLTransform (DOMNode *stylesheet) |
Append an XSLT Transform to the Reference. More... | |
DSIGTransformC14n * | appendCanonicalizationTransform (canonicalizationMethod cm) |
Append a Canonicalization Transform to the Reference. More... | |
void | setPreHashTXFM (TXFMBase *t) |
Append a "debug" transformer. More... | |
Getting Information | |
XSECBinTXFMInputStream * | makeBinInputStream (void) const |
Create an input stream based on the digested byte stream. More... | |
const safeBuffer & | getURISB () |
Return the URI string of the Reference. More... | |
bool | isManifest () |
Determine whether the reference is a manifest. More... | |
DSIGReferenceList * | getManifestReferenceList () |
Get the Manifest. More... | |
Message Digest/Hash manipulation | |
unsigned int | calculateHash (XMLByte *toFill, unsigned int maxToFill) |
Calculate the Hash value of a reference. More... | |
unsigned int | readHash (XMLByte *toFill, unsigned int maxToFill) |
Read the hash from the Reference element. More... | |
bool | checkHash () |
Validate the Reference element. More... | |
void | setHash () |
Set the value of the hash in the Reference. More... | |
Static Public Methods | |
Helper (static) Functions | |
TXFMBase * | DSIGReference::createTXFMChainFromList (TXFMBase *input, DSIGTransformList *lst) |
Create a Transformer chain. More... | |
DSIGTransformList * | loadTransforms (DOMNode *transformsNode, XSECSafeBufferFormatter *formatter, DSIGSignature *sig) |
Load a Transforms list from the <Transforms> DOMNode. More... | |
TXFMBase * | getURIBaseTXFM (DOMDocument *doc, safeBuffer URI, XSECURIResolver *resolver) |
Create a starting point for a TXFM Chain. More... | |
DSIGReferenceList * | loadReferenceListFromXML (DSIGSignature *sig, DOMNode *firstReference) |
Load a series of references. More... | |
bool | verifyReferenceList (DSIGReferenceList *lst, safeBuffer &errorStr) |
Validate a list of references. More... | |
void | hashReferenceList (DSIGReferenceList *list, bool interlocking=true) |
Hash a reference list. More... |
The DSIGReference class creates and manipulates (including hashing and validating) <Reference> elements.
|
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 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 Manifest.
|
|
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.
|
|
Return the URI string of the Reference.
|
|
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
|