Class XMLSignatureInput
java.lang.Object
org.apache.xml.security.signature.XMLSignatureInput
- All Implemented Interfaces:
Cloneable
-
Constructor Summary
ConstructorsConstructorDescriptionXMLSignatureInput(byte[] inputOctets) Construct a XMLSignatureInput from an octet array.XMLSignatureInput(InputStream inputOctetStream) Constructs aXMLSignatureInputfrom 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 TypeMethodDescriptionvoidaddNodeFilter(NodeFilter filter) byte[]getBytes()Returns the byte array from input which was specified as the parameter ofXMLSignatureInputconstructorGets the exclude node of this XMLSignatureInputMethod getHTMLRepresentationgetHTMLRepresentation(Set inclusiveNamespaces) Method getHTMLRepresentationReturns MIMETypeReturns the node set from input which was specified as the parameter ofXMLSignatureInputconstructorgetNodeSet(boolean circunvent) Returns the node set from input which was specified as the parameter ofXMLSignatureInputconstructorReturns the Octect stream(byte Stream) from input which was specified as the parameter ofXMLSignatureInputconstructorprotected InputStreamReturn SourceURIGets the node of this XMLSignatureInputbooleanDetermines if the object has been set up with a ByteArraybooleanDetermines if the object has been set up with an ElementbooleanbooleanIs the object correctly set up?booleanCheck if the structured is needed to be circumbented.booleanDetermines if the object has been set up with a Node setbooleanDetermines if the object has been set up with an octet streamvoidsetExcludeComments(boolean excludeComments) voidsetExcludeNode(Node excludeNode) Sets the exclude node of this XMLSignatureInputvoidsetMIMEType(String MIMEType) Sets MIMETypevoidsetNeedsToBeExpanded(boolean needsToBeExpanded) Set if the structured is needed to be circumbented.voidsetNodeSet(boolean b) voidvoidsetSourceURI(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 aXMLSignatureInputfrom 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 encodingencodingencoding- 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 ofXMLSignatureInputconstructor -
getNodeSet
public Set getNodeSet(boolean circunvent) throws ParserConfigurationException, IOException, SAXException, CanonicalizationException Returns the node set from input which was specified as the parameter ofXMLSignatureInputconstructor- Parameters:
circunvent-- Returns:
- the node set
- Throws:
SAXExceptionIOExceptionParserConfigurationExceptionCanonicalizationExceptionCanonicalizationExceptionIOExceptionParserConfigurationExceptionSAXException
-
getOctetStream
Returns the Octect stream(byte Stream) from input which was specified as the parameter ofXMLSignatureInputconstructor- Returns:
- the Octect stream(byte Stream) from input which was specified as the parameter of
XMLSignatureInputconstructor - Throws:
IOException
-
getOctetStreamReal
- Returns:
- real octect stream
-
getBytes
Returns the byte array from input which was specified as the parameter ofXMLSignatureInputconstructor- Returns:
- the byte[] from input which was specified as the parameter of
XMLSignatureInputconstructor - Throws:
CanonicalizationExceptionIOException
-
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
-
setMIMEType
-
getSourceURI
-
setSourceURI
-
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
-
isExcludeComments
public boolean isExcludeComments()- Returns:
- Returns the excludeComments.
-
setExcludeComments
public void setExcludeComments(boolean excludeComments) - Parameters:
excludeComments- The excludeComments to set.
-
updateOutputStream
- Parameters:
diOs-- Throws:
IOExceptionCanonicalizationException
-
setOutputStream
- Parameters:
os-
-
getResetableInputStream
- Throws:
IOException
-
addNodeFilter
- Parameters:
filter-
-
getNodeFilters
- Returns:
- the node filters
-
setNodeSet
public void setNodeSet(boolean b) - Parameters:
b-
-