Class XMLSignatureInput
java.lang.Object
org.docx4j.org.apache.xml.security.signature.XMLSignatureInput
public class XMLSignatureInput
extends java.lang.Object
Class XMLSignatureInput
- Author:
- Christian Geuer-Pollmann $todo$ check whether an XMLSignatureInput can be _both_, octet stream _and_ node set?
-
Constructor Summary
Constructors Constructor Description XMLSignatureInput(byte[] inputOctets)
Construct a XMLSignatureInput from an octet array.XMLSignatureInput(java.io.InputStream inputOctetStream)
Constructs aXMLSignatureInput
from an octet stream.XMLSignatureInput(java.util.Set<org.w3c.dom.Node> inputNodeSet)
Constructor XMLSignatureInputXMLSignatureInput(org.w3c.dom.Node rootNode)
Construct a XMLSignatureInput from a subtree rooted by rootNode. -
Method Summary
Modifier and Type Method Description void
addNodeFilter(NodeFilter filter)
byte[]
getBytes()
Returns the byte array from input which was specified as the parameter ofXMLSignatureInput
constructororg.w3c.dom.Node
getExcludeNode()
Gets the exclude node of this XMLSignatureInputjava.util.Set<org.w3c.dom.Node>
getInputNodeSet()
Get the Input NodeSet.java.lang.String
getMIMEType()
Returns mimeTypejava.util.List<NodeFilter>
getNodeFilters()
java.util.Set<org.w3c.dom.Node>
getNodeSet()
Returns the node set from input which was specified as the parameter ofXMLSignatureInput
constructorjava.util.Set<org.w3c.dom.Node>
getNodeSet(boolean circumvent)
Returns the node set from input which was specified as the parameter ofXMLSignatureInput
constructorjava.io.InputStream
getOctetStream()
Returns the Octet stream(byte Stream) from input which was specified as the parameter ofXMLSignatureInput
constructorjava.io.InputStream
getOctetStreamReal()
java.lang.String
getSourceURI()
Return SourceURIorg.w3c.dom.Node
getSubNode()
Gets the node of this XMLSignatureInputboolean
isByteArray()
Determines if the object has been set up with a ByteArrayboolean
isElement()
Determines if the object has been set up with an Elementboolean
isExcludeComments()
boolean
isInitialized()
Is the object correctly set up?boolean
isNeedsToBeExpanded()
Check if the structure needs to be expanded.boolean
isNodeSet()
Determines if the object has been set up with a Node setboolean
isOctetStream()
Determines if the object has been set up with an octet streamboolean
isOutputStreamSet()
Determines ifsetOutputStream(java.io.OutputStream)
has been called with a non-null OutputStream.boolean
isSecureValidation()
void
setExcludeComments(boolean excludeComments)
void
setExcludeNode(org.w3c.dom.Node excludeNode)
Sets the exclude node of this XMLSignatureInputvoid
setMIMEType(java.lang.String mimeType)
Sets mimeTypevoid
setNeedsToBeExpanded(boolean needsToBeExpanded)
Set if the structure needs to be expanded.void
setNodeSet(boolean b)
void
setOutputStream(java.io.OutputStream os)
void
setSecureValidation(boolean secureValidation)
void
setSourceURI(java.lang.String sourceURI)
Sets SourceURIjava.lang.String
toString()
Method toStringvoid
updateOutputStream(java.io.OutputStream diOs)
void
updateOutputStream(java.io.OutputStream diOs, boolean c14n11)
-
Constructor Details
-
XMLSignatureInput
public XMLSignatureInput(byte[] inputOctets)Construct a XMLSignatureInput from an octet array.This is a comfort method, which internally converts the byte[] array into an InputStream
NOTE: no defensive copy
- Parameters:
inputOctets
- an octet array which including XML document or node
-
XMLSignatureInput
public XMLSignatureInput(java.io.InputStream inputOctetStream)Constructs aXMLSignatureInput
from an octet stream. The stream is directly read.- Parameters:
inputOctetStream
-
-
XMLSignatureInput
public XMLSignatureInput(org.w3c.dom.Node rootNode)Construct a XMLSignatureInput from a subtree rooted by rootNode. This method included the node and all his descendants in the output.- Parameters:
rootNode
-
-
XMLSignatureInput
public XMLSignatureInput(java.util.Set<org.w3c.dom.Node> inputNodeSet)Constructor XMLSignatureInput- Parameters:
inputNodeSet
-
-
-
Method Details
-
isNeedsToBeExpanded
public boolean isNeedsToBeExpanded()Check if the structure needs to be expanded.- Returns:
- true if so.
-
setNeedsToBeExpanded
public void setNeedsToBeExpanded(boolean needsToBeExpanded)Set if the structure needs to be expanded.- Parameters:
needsToBeExpanded
- true if so.
-
getNodeSet
public java.util.Set<org.w3c.dom.Node> getNodeSet() throws CanonicalizationException, javax.xml.parsers.ParserConfigurationException, java.io.IOException, org.xml.sax.SAXExceptionReturns the node set from input which was specified as the parameter ofXMLSignatureInput
constructor- Returns:
- the node set
- Throws:
org.xml.sax.SAXException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
CanonicalizationException
-
getInputNodeSet
public java.util.Set<org.w3c.dom.Node> getInputNodeSet()Get the Input NodeSet.- Returns:
- the Input NodeSet.
-
getNodeSet
public java.util.Set<org.w3c.dom.Node> getNodeSet(boolean circumvent) throws javax.xml.parsers.ParserConfigurationException, java.io.IOException, org.xml.sax.SAXException, CanonicalizationExceptionReturns the node set from input which was specified as the parameter ofXMLSignatureInput
constructor- Parameters:
circumvent
-- Returns:
- the node set
- Throws:
org.xml.sax.SAXException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
CanonicalizationException
-
getOctetStream
public java.io.InputStream getOctetStream() throws java.io.IOExceptionReturns the Octet stream(byte Stream) from input which was specified as the parameter ofXMLSignatureInput
constructor- Returns:
- the Octet stream(byte Stream) from input which was specified as
the parameter of
XMLSignatureInput
constructor - Throws:
java.io.IOException
-
getOctetStreamReal
public java.io.InputStream getOctetStreamReal()- Returns:
- real octet stream
-
getBytes
Returns the byte array from input which was specified as the parameter ofXMLSignatureInput
constructor- Returns:
- the byte[] from input which was specified as the parameter of
XMLSignatureInput
constructor - Throws:
CanonicalizationException
java.io.IOException
-
isNodeSet
public boolean isNodeSet()Determines if the object has been set up with a Node set- Returns:
- true if the object has been set up with a Node set
-
isElement
public boolean isElement()Determines if the object has been set up with an Element- Returns:
- true if the object has been set up with an Element
-
isOctetStream
public boolean isOctetStream()Determines if the object has been set up with an octet stream- Returns:
- true if the object has been set up with an octet stream
-
isOutputStreamSet
public boolean isOutputStreamSet()Determines ifsetOutputStream(java.io.OutputStream)
has been called with a non-null OutputStream.- Returns:
- true if
setOutputStream(java.io.OutputStream)
has been called with a non-null OutputStream
-
isByteArray
public boolean isByteArray()Determines if the object has been set up with a ByteArray- Returns:
- true is the object has been set up with an octet stream
-
isInitialized
public boolean isInitialized()Is the object correctly set up?- Returns:
- true if the object has been set up correctly
-
getMIMEType
public java.lang.String getMIMEType()Returns mimeType- Returns:
- mimeType
-
setMIMEType
public void setMIMEType(java.lang.String mimeType)Sets mimeType- Parameters:
mimeType
-
-
getSourceURI
public java.lang.String getSourceURI()Return SourceURI- Returns:
- SourceURI
-
setSourceURI
public void setSourceURI(java.lang.String sourceURI)Sets SourceURI- Parameters:
sourceURI
-
-
toString
public java.lang.String toString()Method toString- Overrides:
toString
in classjava.lang.Object
-
getExcludeNode
public org.w3c.dom.Node getExcludeNode()Gets the exclude node of this XMLSignatureInput- Returns:
- Returns the excludeNode.
-
setExcludeNode
public void setExcludeNode(org.w3c.dom.Node excludeNode)Sets the exclude node of this XMLSignatureInput- Parameters:
excludeNode
- The excludeNode to set.
-
getSubNode
public org.w3c.dom.Node getSubNode()Gets the node of this XMLSignatureInput- Returns:
- The excludeNode set.
-
isExcludeComments
public boolean isExcludeComments()- Returns:
- Returns the excludeComments.
-
setExcludeComments
public void setExcludeComments(boolean excludeComments)- Parameters:
excludeComments
- The excludeComments to set.
-
updateOutputStream
public void updateOutputStream(java.io.OutputStream diOs) throws CanonicalizationException, java.io.IOException- Parameters:
diOs
-- Throws:
java.io.IOException
CanonicalizationException
-
updateOutputStream
public void updateOutputStream(java.io.OutputStream diOs, boolean c14n11) throws CanonicalizationException, java.io.IOException- Throws:
CanonicalizationException
java.io.IOException
-
setOutputStream
public void setOutputStream(java.io.OutputStream os)- Parameters:
os
-
-
addNodeFilter
- Parameters:
filter
-
-
getNodeFilters
- Returns:
- the node filters
-
setNodeSet
public void setNodeSet(boolean b)- Parameters:
b
-
-
isSecureValidation
public boolean isSecureValidation() -
setSecureValidation
public void setSecureValidation(boolean secureValidation)
-