|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jcp.xml.dsig.internal.dom.DOMStructure
org.jcp.xml.dsig.internal.dom.DOMReference
public final class DOMReference
Disabled: no SafeJ information.
DOM-based implementation of Reference.
Constructor Summary | |
---|---|
DOMReference(org.w3c.dom.Element refElem,
XMLCryptoContext context,
Provider provider)
Creates a DOMReference from an element. |
|
DOMReference(String uri,
String type,
DigestMethod dm,
List appliedTransforms,
Data result,
List transforms,
String id,
byte[] digestValue,
Provider provider)
|
|
DOMReference(String uri,
String type,
DigestMethod dm,
List appliedTransforms,
Data result,
List transforms,
String id,
Provider provider)
|
|
DOMReference(String uri,
String type,
DigestMethod dm,
List transforms,
String id,
Provider provider)
Creates a Reference from the specified parameters. |
Method Summary | |
---|---|
void |
digest(XMLSignContext signContext)
|
boolean |
equals(Object o)
Indicates whether some other object is "equal to" this one. |
byte[] |
getCalculatedDigestValue()
Returns the calculated digest value of this Reference
after a validation operation. |
Data |
getDereferencedData()
Returns the dereferenced data, if reference caching is enabled. |
InputStream |
getDigestInputStream()
Returns the pre-digested input stream, if reference caching is enabled. |
DigestMethod |
getDigestMethod()
Returns the digest method of this Reference . |
byte[] |
getDigestValue()
Returns the digest value of this Reference . |
org.w3c.dom.Node |
getHere()
Returns the here node. |
String |
getId()
Returns the optional Id attribute of this
Reference , which permits this reference to be
referenced from elsewhere. |
List |
getTransforms()
Returns an unmodifiable
list of Transform s that are contained in this
Reference . |
String |
getType()
Returns the type of data referenced by this URI. |
String |
getURI()
Returns the URI of the referenced data object. |
void |
marshal(org.w3c.dom.Node parent,
String dsPrefix,
DOMCryptoContext context)
|
boolean |
validate(XMLValidateContext validateContext)
Validates this reference. |
Methods inherited from class org.jcp.xml.dsig.internal.dom.DOMStructure |
---|
isFeatureSupported |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.xml.crypto.XMLStructure |
---|
isFeatureSupported |
Constructor Detail |
---|
public DOMReference(String uri, String type, DigestMethod dm, List transforms, String id, Provider provider)
Reference
from the specified parameters.
uri
- the URI (may be null)type
- the type (may be null)dm
- the digest methodtransforms
- a list of Transform
s. The list
is defensively copied to protect against subsequent modification.
May be null
or empty.id
- the reference ID (may be null
)
NullPointerException
- if dm
is null
ClassCastException
- if any of the transforms
are
not of type Transform
public DOMReference(String uri, String type, DigestMethod dm, List appliedTransforms, Data result, List transforms, String id, Provider provider)
public DOMReference(String uri, String type, DigestMethod dm, List appliedTransforms, Data result, List transforms, String id, byte[] digestValue, Provider provider)
public DOMReference(org.w3c.dom.Element refElem, XMLCryptoContext context, Provider provider) throws MarshalException
DOMReference
from an element.
refElem
- a Reference element
MarshalException
Method Detail |
---|
public DigestMethod getDigestMethod()
Reference
Reference
.
getDigestMethod
in interface Reference
public String getId()
Reference
Id
attribute of this
Reference
, which permits this reference to be
referenced from elsewhere.
getId
in interface Reference
Id
attribute (may be null
if not
specified)public String getURI()
URIReference
getURI
in interface URIReference
null
if not specified)public String getType()
URIReference
getType
in interface URIReference
null
if not specified)public List getTransforms()
Reference
unmodifiable
list
of Transform
s that are contained in this
Reference
.
getTransforms
in interface Reference
Transform
s
(may be empty but never null
)public byte[] getDigestValue()
Reference
Reference
.
getDigestValue
in interface Reference
null
if this reference has
not been digested yet. Each invocation of this method returns a new
clone to protect against subsequent modification.public byte[] getCalculatedDigestValue()
Reference
Reference
after a validation operation. This method is useful for debugging if
the reference fails to validate.
getCalculatedDigestValue
in interface Reference
null
if this
reference has not been validated yet. Each invocation of this method
returns a new clone to protect against subsequent modification.public void marshal(org.w3c.dom.Node parent, String dsPrefix, DOMCryptoContext context) throws MarshalException
marshal
in class DOMStructure
MarshalException
public void digest(XMLSignContext signContext) throws XMLSignatureException
XMLSignatureException
public boolean validate(XMLValidateContext validateContext) throws XMLSignatureException
Reference
This method only validates the reference the first time it is invoked. On subsequent invocations, it returns a cached result.
validate
in interface Reference
validateContext
- the validating context
true
if this reference was validated successfully;
false
otherwise
XMLSignatureException
- if an unexpected exception occurs while
validating the referencepublic Data getDereferencedData()
Reference
getDereferencedData
in interface Reference
null
if reference
caching is not enabled or this reference has not been generated or
validatedpublic InputStream getDigestInputStream()
Reference
getDigestInputStream
in interface Reference
null
if reference caching is not enabled or this
reference has not been generated or validatedpublic org.w3c.dom.Node getHere()
DOMURIReference
getHere
in interface DOMURIReference
public boolean equals(Object o)
Object
The equals
method implements an equivalence relation
on non-null object references:
x
, x.equals(x)
should return
true
.
x
and y
, x.equals(y)
should return true
if and only if
y.equals(x)
returns true
.
x
, y
, and z
, if
x.equals(y)
returns true
and
y.equals(z)
returns true
, then
x.equals(z)
should return true
.
x
and y
, multiple invocations of
x.equals(y)
consistently return true
or consistently return false
, provided no
information used in equals
comparisons on the
objects is modified.
x
,
x.equals(null)
should return false
.
The equals
method for class Object
implements
the most discriminating possible equivalence relation on objects;
that is, for any non-null reference values x
and
y
, this method returns true
if and only
if x
and y
refer to the same object
(x == y
has the value true
).
Note that it is generally necessary to override the hashCode
method whenever this method is overridden, so as to maintain the
general contract for the hashCode
method, which states
that equal objects must have equal hash codes.
equals
in class Object
o
- the reference object with which to compare.
true
if this object is the same as the obj
argument; false
otherwise.Object.hashCode()
,
HashMap
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |