Module org.apache.santuario.xmlsec
Class XMLSignatureInput
java.lang.Object
org.apache.xml.security.signature.XMLSignatureInput
- Direct Known Subclasses:
XMLSignatureByteInput,XMLSignatureDigestInput,XMLSignatureNodeInput,XMLSignatureNodeSetInput,XMLSignatureStreamInput
The XMLSignature Input
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstruct a XMLSignatureInputprotectedXMLSignatureInput(Set<Node> nodeSet) protectedXMLSignatureInput(Node rootNode) Construct a XMLSignatureInput from a subtree rooted by rootNode. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddNodeFilter(NodeFilter filter) protected voidcanonicalize(OutputStream output, boolean c14n11) Canonicalizes this object to the output stream.protected abstract Nodebyte[]getBytes()Returns the byte array from input which was specified as the parameter ofXMLSignatureInputconstructor OR tries to reconstruct that if the element or node was already processed.Get the Input NodeSet.Some Transforms may require explicit MIME type, charset (IANA registered "character set"), or other such information concerning the data they are receiving from an earlier Transform or the source data, although no Transform algorithm specified in this document needs such explicit information.final List<NodeFilter> Returns the node set from input which was specified as the parameter ofXMLSignatureInputconstructorGets the node of this XMLSignatureInputabstract InputStreamabstract booleanbooleanDetermines if the object has been set up with an ElementbooleanbooleanbooleanbooleanbooleanvoidsetExcludeComments(boolean excludeComments) voidsetExcludeNode(Node excludeNode) Sets the exclude node of this XMLSignatureInputvoidsetMIMEType(String mimeType) Some Transforms may require explicit MIME type, charset (IANA registered "character set"), or other such information concerning the data they are receiving from an earlier Transform or the source data, although no Transform algorithm specified in this document needs such explicit information.voidsetNeedsToBeExpanded(boolean needsToBeExpanded) Set if the structure needs to be expanded.final voidsetNodeSet(boolean nodeSet) voidsetOutputStream(OutputStream outputStream) voidsetSecureValidation(boolean secureValidation) Set to false to disable validation in r/w operations.voidsetSourceURI(String sourceURI) toString()Creates a short description of this instance.voidwrite(OutputStream output) Writes the data to the output stream.abstract voidwrite(OutputStream output, boolean c14n11) Writes the data to the output stream.
-
Constructor Details
-
XMLSignatureInput
protected XMLSignatureInput()Construct a XMLSignatureInput -
XMLSignatureInput
Construct a XMLSignatureInput from a subtree rooted by rootNode. This method included the node and all its descendants in the output.- Parameters:
rootNode-
-
XMLSignatureInput
- Parameters:
nodeSet-
-
-
Method Details
-
hasUnprocessedInput
public abstract boolean hasUnprocessedInput()- Returns:
- true if this instance still can provide the unprocessed input
which was specified as the parameter of
XMLSignatureInput
-
getUnprocessedInput
- Returns:
- the
InputStreamfrom input which was specified as the parameter ofXMLSignatureInputconstructor - Throws:
IOException
-
convertToNode
protected abstract Node convertToNode() throws org.apache.xml.security.parser.XMLParserException, IOException- Returns:
- data given in constructor converted to a
Nodeor null if such conversion is not supported by thisXMLSignatureInput - Throws:
org.apache.xml.security.parser.XMLParserExceptionIOException
-
write
Writes the data to the output stream.- Parameters:
output-- Throws:
CanonicalizationExceptionIOException
-
write
public abstract void write(OutputStream output, boolean c14n11) throws CanonicalizationException, IOException Writes the data to the output stream.- Parameters:
output-c14n11-- Throws:
CanonicalizationExceptionIOException- See Also:
-
getInputNodeSet
Get the Input NodeSet.- Returns:
- the Input NodeSet.
-
getNodeSet
Returns the node set from input which was specified as the parameter ofXMLSignatureInputconstructorCan call the
convertToNode()to parse theNodefrom the input data. The internal state will change then.- Returns:
- the node set
- Throws:
org.apache.xml.security.parser.XMLParserExceptionIOException
-
getSubNode
Gets the node of this XMLSignatureInput- Returns:
- The excludeNode set.
-
addNodeFilter
public void addNodeFilter(NodeFilter filter) throws org.apache.xml.security.parser.XMLParserException, IOException - Parameters:
filter-- Throws:
org.apache.xml.security.parser.XMLParserExceptionIOException
-
getNodeFilters
- Returns:
- the node filters
-
setNodeSet
public final void setNodeSet(boolean nodeSet) - Parameters:
nodeSet-
-
getBytes
Returns the byte array from input which was specified as the parameter ofXMLSignatureInputconstructor OR tries to reconstruct that if the element or node was already processed.- Returns:
- the byte array
- Throws:
CanonicalizationExceptionIOException
-
isNodeSet
public boolean isNodeSet()- Returns:
- true if the
XMLSignatureInput(Set)was used or the node set was parsed from an input coming from another constructor.
-
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
-
getPreCalculatedDigest
- Returns:
- String given through constructor. Null by default, see extensions of this class.
-
getExcludeNode
- Returns:
- the exclude node of this XMLSignatureInput
-
setExcludeNode
Sets the exclude node of this XMLSignatureInput- Parameters:
excludeNode- The excludeNode to set.
-
isExcludeComments
public boolean isExcludeComments()- Returns:
- Returns the excludeComments.
-
setExcludeComments
public void setExcludeComments(boolean excludeComments) - Parameters:
excludeComments- The excludeComments to set.
-
getSourceURI
- Returns:
- Source URI
-
setSourceURI
- Parameters:
sourceURI-
-
getMIMEType
Some Transforms may require explicit MIME type, charset (IANA registered "character set"), or other such information concerning the data they are receiving from an earlier Transform or the source data, although no Transform algorithm specified in this document needs such explicit information.Such data characteristics are provided as parameters to the Transform algorithm and should be described in the specification for the algorithm.
- Returns:
- mimeType
-
setMIMEType
Some Transforms may require explicit MIME type, charset (IANA registered "character set"), or other such information concerning the data they are receiving from an earlier Transform or the source data, although no Transform algorithm specified in this document needs such explicit information.Such data characteristics are provided as parameters to the Transform algorithm and should be described in the specification for the algorithm.
- Parameters:
mimeType-
-
isNeedsToBeExpanded
public boolean isNeedsToBeExpanded()- Returns:
- true if the structure needs to be expanded.
-
setNeedsToBeExpanded
public void setNeedsToBeExpanded(boolean needsToBeExpanded) Set if the structure needs to be expanded.- Parameters:
needsToBeExpanded- true if so.
-
isSecureValidation
public boolean isSecureValidation()- Returns:
- true by default, enabled validation in r/w operations
-
setSecureValidation
public void setSecureValidation(boolean secureValidation) Set to false to disable validation in r/w operations.- Parameters:
secureValidation- default is true.
-
isOutputStreamSet
public boolean isOutputStreamSet()- Returns:
- true if
setOutputStream(java.io.OutputStream)has been called with a non-null OutputStream
-
setOutputStream
- Parameters:
outputStream- this stream will be ignored inwrite(OutputStream)method
-
getOutputStream
- Returns:
OutputStreamset insetOutputStream(OutputStream)
-
toString
Creates a short description of this instance. -
canonicalize
protected void canonicalize(OutputStream output, boolean c14n11) throws CanonicalizationException, IOException Canonicalizes this object to the output stream.- Parameters:
output-c14n11-- Throws:
CanonicalizationExceptionIOException
-