public abstract class ReferenceType extends DOMURIReferenceImpl
Transforms and are processed according to the reference
processing model of XMLDSig.| Modifier and Type | Class and Description |
|---|---|
protected static class |
ReferenceType.SubTreeNodeSetFix |
DOMStructure.NodeWrapper| Modifier and Type | Field and Description |
|---|---|
protected CachedData |
cachedCanonInputData_
The (NodeSet) data before the last canonicalization transform (implicit or explicit).
|
protected CachedData |
cachedDereferencedData_
The cached dereferenced data.
|
protected CachedInputStream |
cachedDigestInput_
The cached digest input.
|
protected String |
id_
The
Id-attribute value. |
protected Data |
result_
The result of processing any transforms that have already been applied to
the referenced data.
|
protected TransformsType |
transforms_
The
Transforms. |
type_, uri_implMap_, state_, STATE_CREATED, STATE_MARSHALED, STATE_UNINITIALIZED, STATE_UNMARSHALED| Modifier | Constructor and Description |
|---|---|
protected |
ReferenceType(Node node)
Creates a new instance of this
ReferenceType with the
specified node. |
protected |
ReferenceType(String uri,
List appliedTransforms,
Data result,
List transforms,
String type,
String id)
Creates a new instance of this
ReferenceType with the
specified URI reference, a list of TransformImpls that have already
been applied, the result of the processing of the sequence of
appliedTransforms, Type-attribute value and
Id-attribute value. |
protected |
ReferenceType(String uri,
List transforms,
String type,
String id)
Creates a new instance of this
ReferenceType with the
specified URI reference, a list of Transform
s, Type-attribute value and Id-attribute value. |
protected |
ReferenceType(String uri,
String type)
Creates a new instance of this
ReferenceType with the
specified URI and Type-attribute value. |
protected |
ReferenceType(String uri,
TransformsType transforms,
String type,
String id)
Creates a new instance of this
ReferenceType with the
specified URI reference, transforms of TransformsType containing a
list of Transforms, Type
-attribute value and Id-attribute value. |
| Modifier and Type | Method and Description |
|---|---|
Data |
dereference(XMLCryptoContext context)
Dereferences this
ReferenceType according to reference
processing rules of XMLDSig. |
InputStream |
dereferenceAndCanonicalize(XMLCryptoContext context)
Dereferences this
ReferenceType according to the reference
processing rules of XMLDSig and applies a final canonicalization if a
node-set is returned by the last applied transform. |
Data |
dereferenceButDontTransform(XMLCryptoContext context)
Dereferences this
ReferenceType according to reference
processing rules of XMLDSig, with the exception that
Transforms are not applied. |
Data |
getCanonInputData()
Returns the cached input data into the final canonicalization if
caching
this data is enabled. |
protected List |
getChildStructures()
Returns a list containing the
TransformsImpl child structure. |
Data |
getDereferencedData()
Returns the dereferenced data if reference caching is enabled.
|
String |
getId()
Returns the optional
Id-attribute of this reference. |
String |
getLocalName()
Returns the local name of the represented XML element.
|
List |
getTransforms()
Returns an
unmodifiable list of Transforms that are
contained in this reference. |
protected Attr |
marshalIDAttribute(DOMCryptoContext context,
Element parent)
Marshals the XML representation of an optional
Id-attribute
represented by this DOMStructure. |
protected void |
putChildStructure(DOMStructure childStructure)
Puts the
TransformsImpl child structure. |
protected void |
unmarshalAttributes(NamedNodeMap attributes,
DOMCryptoContext context)
Unmarshals the
URI and Type attributes. |
getHere, getType, getURI, marshalAttributesaddBytesToElement, addBytesToElement, clearMarshalling, clearMarshalling, getBytesFromElement, getBytesFromElementStream, getChildStructureVersion, getImplClass, getInstance, getInstance, getNamespace, getNode, getParentStructure, getParentStructureOf, getQualifiedName, getQualifiedName, hasNSDeclAttrInScope, isFeatureSupported, isNSDeclInScope, marshal, marshalElement, newIDforLookUp, putImplClass, setBackToCompatibilityPrior1_14, setNode, setParentStructure, toString, unmarshal, unmarshalElement, unmarshalIDAttribute, unmarshalStructures, wrapNodeprotected TransformsType transforms_
Transforms.protected Data result_
protected String id_
Id-attribute value.protected CachedInputStream cachedDigestInput_
protected CachedData cachedDereferencedData_
protected CachedData cachedCanonInputData_
protected ReferenceType(Node node)
ReferenceType with the
specified node.node - the nodeprotected ReferenceType(String uri, String type)
ReferenceType with the
specified URI and Type-attribute value.uri - the URItype - the Type-attribute valueprotected ReferenceType(String uri, TransformsType transforms, String type, String id)
ReferenceType with the
specified URI reference, transforms of TransformsType containing a
list of Transforms, Type
-attribute value and Id-attribute value.uri - the URI referencetransforms - of TransformsType containing a list of
Transforms (may be null
or empty). The transforms object is not defensively copied.type - the value of the Type-attributeid - the value of the Id-attributeIllegalArgumentException - if uri is not RFC 2396 compliantprotected ReferenceType(String uri, List transforms, String type, String id)
ReferenceType with the
specified URI reference, a list of Transform
s, Type-attribute value and Id-attribute value.uri - the URI referencetransforms - a list of Transforms (may be
null or empty)type - the value of the Type-attributeid - the value of the Id-attributeIllegalArgumentException - if uri is not RFC 2396 compliantprotected ReferenceType(String uri, List appliedTransforms, Data result, List transforms, String type, String id)
ReferenceType with the
specified URI reference, a list of TransformImpls that have already
been applied, the result of the processing of the sequence of
appliedTransforms, Type-attribute value and
Id-attribute value.uri - the URI referenceappliedTransforms - a list of TransformImpls that have already been appliedresult - the result of processing the sequence of
appliedTransformstransforms - a list of Transforms (may be
null or empty)type - the value of the Type-attributeid - the value of the Id-attributeClassCastException - if appliedTransforms or transforms
contains any elements not of type TransformImplNullPointerException - if appliedTransforms is nullIllegalArgumentException - if appliedTransforms is emptyIllegalArgumentException - if uri is not RFC 2396 compliantpublic String getLocalName()
DOMStructuregetLocalName in class DOMStructureDOMStructure.getLocalName()public List getTransforms()
unmodifiable list of Transforms that are
contained in this reference.Transforms (may be empty but
never null)Reference.getTransforms()public String getId()
Id-attribute of this reference.Id attribute (may be null if not
specified)Reference.getId()public Data getDereferencedData()
ReferenceType(String, List, Data, List, String, String) and
appliedtransforms != null && ! appliedtransforms.isEmpty() it returns the
result (the data fed into the Reference)null if reference caching is
not enabled or this reference has not yet been dereferenced.Reference.getDereferencedData()public Data getCanonInputData()
caching
this data is enabled. This is the result of dereferencing the reference
and appliying all transforms except of the final canonicalization.
DOMCryptoContext.CACHE_CANON_INPUT_DATA
must be set to cache the canonicalization input data and that the data is only cached
if it is an instance of NodeSetData.null if
caching
canonicalization input data is not enabled or the data is not an instance of
DOMNodeSetData.public Data dereferenceButDontTransform(XMLCryptoContext context) throws URIReferenceException, TransformException
ReferenceType according to reference
processing rules of XMLDSig, with the exception that
Transforms are not applied.context - the contextData after dereferencing this ReferenceTypeURIReferenceException - if an exception occurs during dereferencingTransformException - if an exception occurs during transformationpublic Data dereference(XMLCryptoContext context) throws URIReferenceException, TransformException
ReferenceType according to reference
processing rules of XMLDSig.context - the contextData after dereferencing this ReferenceTypeURIReferenceException - if an exception occurs during dereferencingTransformException - if an exception occurs during transformationpublic InputStream dereferenceAndCanonicalize(XMLCryptoContext context) throws NoSuchAlgorithmException, URIReferenceException, TransformException
ReferenceType according to the reference
processing rules of XMLDSig and applies a final canonicalization if a
node-set is returned by the last applied transform.context - the contextNoSuchAlgorithmException - if no implementation of the canonicalization algorithm can be foundURIReferenceException - if an exception occurs during dereferencingTransformException - if an exception occurs during transformationprotected Attr marshalIDAttribute(DOMCryptoContext context, Element parent)
DOMStructureId-attribute
represented by this DOMStructure.
This method is called by DOMStructure.marshal(DOMCryptoContext, Node, Node).
A subclass has to overwrite this method in order to marshal an
Id-attribute.
marshalIDAttribute in class DOMStructurecontext - the marshal contextparent - the element is the parent of the attribute node created however, an
the attribute node is not a child of it's parent element. see XPath.Id-attribute if any, otherwise
nullDOMStructure.marshalIDAttribute(DOMCryptoContext,
Element)protected void unmarshalAttributes(NamedNodeMap attributes, DOMCryptoContext context) throws MarshalException
DOMURIReferenceImplURI and Type attributes.unmarshalAttributes in class DOMURIReferenceImplattributes - the Attributes to unmarshalcontext - the marshal contextMarshalException - if an exception occurs during unmarshalingDOMStructure.unmarshalAttributes(org.w3c.dom.NamedNodeMap,
DOMCryptoContext)protected List getChildStructures()
TransformsImpl child structure.getChildStructures in class DOMStructureDOMStructures (may be empty, but never
null)protected void putChildStructure(DOMStructure childStructure) throws MarshalException
TransformsImpl child structure.putChildStructure in class DOMStructurechildStructure - the unmarshalled child structureMarshalException© 2002-2005 IAIK, © 2004, 2006 - 2019 Stiftung SIC