protected class XMLSignatureImpl.SignatureValueImpl extends XmldsigDOMStructure implements XMLSignature.SignatureValue
SignatureValue element that supports
the DOM XML representation and marshaling mechanism.DOMStructure.NodeWrapper| Modifier and Type | Field and Description |
|---|---|
protected String |
id_
The
id-attribute value. |
protected boolean |
valid_
Is the signature value valid?
|
protected boolean |
validated_
Has the signature value been validated?
|
protected byte[] |
value_
The signature value.
|
implMap_, state_, STATE_CREATED, STATE_MARSHALED, STATE_UNINITIALIZED, STATE_UNMARSHALED| Constructor and Description |
|---|
SignatureValueImpl(byte[] value,
String id)
Creates a new instance of this
SignatureValueImpl with the
specified provider config, signature value and id-attribute
value. |
SignatureValueImpl(DOMCryptoContext context,
Node node)
Creates a new instance of this
SignatureValueImpl with the
specified provider config, context and node to unmarshal from. |
SignatureValueImpl(String id)
Creates a new instance of this
SignatureValueImpl with the
specified provider config and id-attribute value. |
| Modifier and Type | Method and Description |
|---|---|
void |
appendValue(DOMCryptoContext context,
byte[] value) |
String |
getId()
Returns the optional
Id attribute of this
SignatureValue, which permits this element to be referenced
from elsewhere. |
String |
getLocalName()
Returns the local name of the represented XML element.
|
byte[] |
getValue()
Returns the signature value of this
SignatureValue. |
protected Element |
marshalElement(DOMCryptoContext context,
Node parent,
Node nextSibling)
Marshals the XML representation of the
Element represented by this
DOMStructure and returns it. |
protected Attr |
marshalIDAttribute(DOMCryptoContext context,
Element parent)
Marshals the XML representation of an optional
Id-attribute
represented by this DOMStructure. |
protected void |
unmarshalAttributes(NamedNodeMap attributes,
DOMCryptoContext context)
Unmarshal the given
attributes. |
protected void |
unmarshalElement(DOMCryptoContext context,
Element element)
Unmarshals the given
element. |
boolean |
validate(XMLValidateContext validateContext)
Validates the signature value.
|
getNamespace, initaddBytesToElement, addBytesToElement, clearMarshalling, clearMarshalling, getBytesFromElement, getBytesFromElementStream, getChildStructures, getChildStructureVersion, getHere, getImplClass, getInstance, getInstance, getNode, getParentStructure, getParentStructureOf, getQualifiedName, getQualifiedName, hasNSDeclAttrInScope, isFeatureSupported, isNSDeclInScope, marshal, marshalAttributes, newIDforLookUp, putChildStructure, putImplClass, setBackToCompatibilityPrior1_14, setNode, setParentStructure, toString, unmarshal, unmarshalIDAttribute, unmarshalStructures, wrapNodeclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitisFeatureSupportedprotected String id_
id-attribute value.protected byte[] value_
protected boolean validated_
protected boolean valid_
public SignatureValueImpl(DOMCryptoContext context, Node node) throws MarshalException
SignatureValueImpl with the
specified provider config, context and node to unmarshal from.context - the contextnode - the node to unmarshal fromMarshalException - if an exception occurs during unmarshalingpublic SignatureValueImpl(String id)
SignatureValueImpl with the
specified provider config and id-attribute value.id - the id-attribute value (may be null)NullPointerException - if config is nullpublic SignatureValueImpl(byte[] value,
String id)
SignatureValueImpl with the
specified provider config, signature value and id-attribute
value.value - the raw signature valueid - the id-attribute valuepublic String getLocalName()
DOMStructuregetLocalName in class DOMStructureDOMStructure.getLocalName()public String getId()
javax.xml.crypto.dsig.XMLSignature.SignatureValueId attribute of this
SignatureValue, which permits this element to be referenced
from elsewhere.getId in interface XMLSignature.SignatureValueId attribute (may be null if not
specified)XMLSignature.SignatureValue.getId()public byte[] getValue()
javax.xml.crypto.dsig.XMLSignature.SignatureValueSignatureValue.getValue in interface XMLSignature.SignatureValuenull if the
XMLSignature has not been signed yet). Each
invocation of this method returns a new clone of the array to
prevent subsequent modification.XMLSignature.SignatureValue.getValue()public boolean validate(XMLValidateContext validateContext) throws XMLSignatureException
javax.xml.crypto.dsig.XMLSignature.SignatureValueSignedInfo
of the XMLSignature.
This method only validates the signature the first time it is invoked. On subsequent invocations, it returns a cached result.
validate in interface XMLSignature.SignatureValuevalidateContext - the validating contexttrue if the signature was validated successfully;
false otherwiseXMLSignatureException - if an unexpected exception occurs while validating the signatureXMLSignature.SignatureValue.validate(javax.xml.crypto.dsig.XMLValidateContext)protected 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(javax.xml.crypto.dom.DOMCryptoContext,
Element)protected Element marshalElement(DOMCryptoContext context, Node parent, Node nextSibling) throws MarshalException
DOMStructureElement represented by this
DOMStructure and returns it.
This method is called by DOMStructure.marshal(DOMCryptoContext, Node, Node).
marshalElement in class DOMStructurecontext - the marshal contextparent - where to place the marshalled elementnextSibling - before which to place the marshalled nodeElementMarshalException - if an exception occurs during marshalingDOMStructure.marshalElement(DOMCryptoContext,
Node, Node)public void appendValue(DOMCryptoContext context, byte[] value) throws MarshalException
context - value - MarshalExceptionprotected void unmarshalAttributes(NamedNodeMap attributes, DOMCryptoContext context) throws MarshalException
DOMStructureattributes.
This method is called by DOMStructure.unmarshal(DOMCryptoContext).
A subclass has to overwrite this method to perform any special unmarshaling required.
unmarshalAttributes in class DOMStructureattributes - the Attributes to unmarshalcontext - the marshal contextMarshalException - if an exception occurs during unmarshalingDOMStructure.unmarshalAttributes(org.w3c.dom.NamedNodeMap,
javax.xml.crypto.dom.DOMCryptoContext)protected void unmarshalElement(DOMCryptoContext context, Element element) throws MarshalException
DOMStructureelement.
This method is called by DOMStructure.unmarshal(DOMCryptoContext).
A subclass has to overwrite this method to perform any special unmarshaling required.
unmarshalElement in class DOMStructurecontext - the marshal contextelement - the element to be unmarshalMarshalException - if an exception occurs during unmarshalingDOMStructure.unmarshalElement(javax.xml.crypto.dom.DOMCryptoContext,
Element)© 2002-2005 IAIK, © 2004, 2006 - 2019 Stiftung SIC