Class XMLSignatureInput
java.lang.Object
org.apache.xml.security.signature.XMLSignatureInput
- All Implemented Interfaces:
Cloneable
Class XMLSignatureInput
- Author:
- Christian Geuer-Pollmann $todo$ check whether an XMLSignatureInput can be _both_, octet stream _and_ node set?
-
Constructor Summary
ConstructorsConstructorDescriptionXMLSignatureInput
(byte[] inputOctets) Construct a XMLSignatureInput from an octet array.XMLSignatureInput
(InputStream inputOctetStream) Constructs aXMLSignatureInput
from an octet stream.XMLSignatureInput
(String inputStr) Deprecated.XMLSignatureInput
(String inputStr, String encoding) Deprecated.XMLSignatureInput
(Set inputNodeSet) Constructor XMLSignatureInputXMLSignatureInput
(Node rootNode) Construct a XMLSignatureInput from a subtree rooted by rootNode. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addNodeFilter
(NodeFilter filter) byte[]
getBytes()
Returns the byte array from input which was specified as the parameter ofXMLSignatureInput
constructorGets the exclude node of this XMLSignatureInputMethod getHTMLRepresentationgetHTMLRepresentation
(Set inclusiveNamespaces) Method getHTMLRepresentationReturns MIMETypeReturns the node set from input which was specified as the parameter ofXMLSignatureInput
constructorgetNodeSet
(boolean circunvent) Returns the node set from input which was specified as the parameter ofXMLSignatureInput
constructorReturns the Octect stream(byte Stream) from input which was specified as the parameter ofXMLSignatureInput
constructorprotected InputStream
Return SourceURIGets the node of this XMLSignatureInputboolean
Determines if the object has been set up with a ByteArrayboolean
Determines if the object has been set up with an Elementboolean
boolean
Is the object correctly set up?boolean
Check if the structured is needed to be circumbented.boolean
Determines if the object has been set up with a Node setboolean
Determines if the object has been set up with an octet streamvoid
setExcludeComments
(boolean excludeComments) void
setExcludeNode
(Node excludeNode) Sets the exclude node of this XMLSignatureInputvoid
setMIMEType
(String MIMEType) Sets MIMETypevoid
setNeedsToBeExpanded
(boolean needsToBeExpanded) Set if the structured is needed to be circumbented.void
setNodeSet
(boolean b) void
void
setSourceURI
(String SourceURI) Sets SourceURItoString()
Method toStringvoid
-
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
Constructs aXMLSignatureInput
from an octet stream. The stream is directly read.- Parameters:
inputOctetStream
-
-
XMLSignatureInput
Deprecated.Construct a XMLSignatureInput from a String.This is a comfort method, which internally converts the String into a byte[] array using the
String.getBytes()
method.- Parameters:
inputStr
- the input String which including XML document or node
-
XMLSignatureInput
Deprecated.Construct a XMLSignatureInput from a String with a given encoding.This is a comfort method, which internally converts the String into a byte[] array using the
String.getBytes()
method.- Parameters:
inputStr
- the input String with encodingencoding
encoding
- the encoding ofinputStr
- Throws:
UnsupportedEncodingException
-
XMLSignatureInput
Construct a XMLSignatureInput from a subtree rooted by rootNode. This method included the node and all his descendants in the output.- Parameters:
rootNode
-
-
XMLSignatureInput
Constructor XMLSignatureInput- Parameters:
inputNodeSet
-usedXPathAPI
-
-
-
Method Details
-
isNeedsToBeExpanded
public boolean isNeedsToBeExpanded()Check if the structured is needed to be circumbented.- Returns:
- true if so.
-
setNeedsToBeExpanded
public void setNeedsToBeExpanded(boolean needsToBeExpanded) Set if the structured is needed to be circumbented.- Parameters:
needsToBeExpanded
- true if so.
-
getNodeSet
public Set getNodeSet() throws CanonicalizationException, ParserConfigurationException, IOException, SAXExceptionReturns the node set from input which was specified as the parameter ofXMLSignatureInput
constructor -
getNodeSet
public Set getNodeSet(boolean circunvent) throws ParserConfigurationException, IOException, SAXException, CanonicalizationException Returns the node set from input which was specified as the parameter ofXMLSignatureInput
constructor- Parameters:
circunvent
-- Returns:
- the node set
- Throws:
SAXException
IOException
ParserConfigurationException
CanonicalizationException
CanonicalizationException
IOException
ParserConfigurationException
SAXException
-
getOctetStream
Returns the Octect stream(byte Stream) from input which was specified as the parameter ofXMLSignatureInput
constructor- Returns:
- the Octect stream(byte Stream) from input which was specified as the parameter of
XMLSignatureInput
constructor - Throws:
IOException
-
getOctetStreamReal
- Returns:
- real octect 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
IOException
-
isNodeSet
public boolean isNodeSet()Determines if the object has been set up with a Node set- Returns:
- true is 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 is the object has been set up with a Node set
-
isOctetStream
public boolean isOctetStream()Determines if the object has been set up with an octet stream- Returns:
- true is the object has been set up with an octet stream
-
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
Returns MIMEType- Returns:
- MIMEType
-
setMIMEType
Sets MIMEType- Parameters:
MIMEType
-
-
getSourceURI
Return SourceURI- Returns:
- SourceURI
-
setSourceURI
Sets SourceURI- Parameters:
SourceURI
-
-
toString
Method toString -
getHTMLRepresentation
Method getHTMLRepresentation- Returns:
- The HTML representation for this XMLSignature
- Throws:
XMLSignatureException
-
getHTMLRepresentation
Method getHTMLRepresentation- Parameters:
inclusiveNamespaces
-- Returns:
- The HTML representation for this XMLSignature
- Throws:
XMLSignatureException
-
getExcludeNode
Gets the exclude node of this XMLSignatureInput- Returns:
- Returns the excludeNode.
-
setExcludeNode
Sets the exclude node of this XMLSignatureInput- Parameters:
excludeNode
- The excludeNode to set.
-
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
- Parameters:
diOs
-- Throws:
IOException
CanonicalizationException
-
setOutputStream
- Parameters:
os
-
-
getResetableInputStream
- Throws:
IOException
-
addNodeFilter
- Parameters:
filter
-
-
getNodeFilters
- Returns:
- the node filters
-
setNodeSet
public void setNodeSet(boolean b) - Parameters:
b
-
-