Class XMLSignatureInput
- java.lang.Object
-
- org.apache.xml.security.signature.XMLSignatureInput
-
- All Implemented Interfaces:
java.lang.Cloneable
public class XMLSignatureInput extends java.lang.Object implements java.lang.CloneableClass 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 aXMLSignatureInputfrom an octet stream.XMLSignatureInput(java.lang.String inputStr)Deprecated.XMLSignatureInput(java.lang.String inputStr, java.lang.String encoding)Deprecated.XMLSignatureInput(java.util.Set inputNodeSet)Constructor XMLSignatureInputXMLSignatureInput(org.w3c.dom.Node rootNode)Construct a XMLSignatureInput from a subtree rooted by rootNode.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddNodeFilter(NodeFilter filter)byte[]getBytes()Returns the byte array from input which was specified as the parameter ofXMLSignatureInputconstructororg.w3c.dom.NodegetExcludeNode()Gets the exclude node of this XMLSignatureInputjava.lang.StringgetHTMLRepresentation()Method getHTMLRepresentationjava.lang.StringgetHTMLRepresentation(java.util.Set inclusiveNamespaces)Method getHTMLRepresentationjava.lang.StringgetMIMEType()Returns MIMETypejava.util.ListgetNodeFilters()java.util.SetgetNodeSet()Returns the node set from input which was specified as the parameter ofXMLSignatureInputconstructorjava.util.SetgetNodeSet(boolean circunvent)Returns the node set from input which was specified as the parameter ofXMLSignatureInputconstructorjava.io.InputStreamgetOctetStream()Returns the Octect stream(byte Stream) from input which was specified as the parameter ofXMLSignatureInputconstructorjava.io.InputStreamgetOctetStreamReal()protected java.io.InputStreamgetResetableInputStream()java.lang.StringgetSourceURI()Return SourceURIorg.w3c.dom.NodegetSubNode()Gets the node of this XMLSignatureInputbooleanisByteArray()Determines if the object has been set up with a ByteArraybooleanisElement()Determines if the object has been set up with an ElementbooleanisExcludeComments()booleanisInitialized()Is the object correctly set up?booleanisNeedsToBeExpanded()Check if the structured is needed to be circumbented.booleanisNodeSet()Determines if the object has been set up with a Node setbooleanisOctetStream()Determines if the object has been set up with an octet streamvoidsetExcludeComments(boolean excludeComments)voidsetExcludeNode(org.w3c.dom.Node excludeNode)Sets the exclude node of this XMLSignatureInputvoidsetMIMEType(java.lang.String MIMEType)Sets MIMETypevoidsetNeedsToBeExpanded(boolean needsToBeExpanded)Set if the structured is needed to be circumbented.voidsetNodeSet(boolean b)voidsetOutputStream(java.io.OutputStream os)voidsetSourceURI(java.lang.String SourceURI)Sets SourceURIjava.lang.StringtoString()Method toStringvoidupdateOutputStream(java.io.OutputStream diOs)
-
-
-
Constructor Detail
-
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 aXMLSignatureInputfrom an octet stream. The stream is directly read.- Parameters:
inputOctetStream-
-
XMLSignatureInput
public XMLSignatureInput(java.lang.String inputStr)
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
public XMLSignatureInput(java.lang.String inputStr, java.lang.String encoding) throws java.io.UnsupportedEncodingExceptionDeprecated.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:
java.io.UnsupportedEncodingException
-
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 inputNodeSet)
Constructor XMLSignatureInput- Parameters:
inputNodeSet-usedXPathAPI-
-
-
Method Detail
-
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 java.util.Set 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 ofXMLSignatureInputconstructor- Returns:
- the node set
- Throws:
org.xml.sax.SAXExceptionjava.io.IOExceptionjavax.xml.parsers.ParserConfigurationExceptionCanonicalizationExceptionCanonicalizationExceptionjava.io.IOExceptionjavax.xml.parsers.ParserConfigurationExceptionorg.xml.sax.SAXException
-
getNodeSet
public java.util.Set getNodeSet(boolean circunvent) throws javax.xml.parsers.ParserConfigurationException, java.io.IOException, org.xml.sax.SAXException, CanonicalizationExceptionReturns the node set from input which was specified as the parameter ofXMLSignatureInputconstructor- Parameters:
circunvent-- Returns:
- the node set
- Throws:
org.xml.sax.SAXExceptionjava.io.IOExceptionjavax.xml.parsers.ParserConfigurationExceptionCanonicalizationExceptionCanonicalizationExceptionjava.io.IOExceptionjavax.xml.parsers.ParserConfigurationExceptionorg.xml.sax.SAXException
-
getOctetStream
public java.io.InputStream getOctetStream() throws java.io.IOExceptionReturns 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:
java.io.IOException
-
getOctetStreamReal
public java.io.InputStream getOctetStreamReal()
- Returns:
- real octect stream
-
getBytes
public byte[] getBytes() throws java.io.IOException, CanonicalizationExceptionReturns 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:
CanonicalizationExceptionjava.io.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
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:
toStringin classjava.lang.Object
-
getHTMLRepresentation
public java.lang.String getHTMLRepresentation() throws XMLSignatureExceptionMethod getHTMLRepresentation- Returns:
- The HTML representation for this XMLSignature
- Throws:
XMLSignatureException
-
getHTMLRepresentation
public java.lang.String getHTMLRepresentation(java.util.Set inclusiveNamespaces) throws XMLSignatureExceptionMethod getHTMLRepresentation- Parameters:
inclusiveNamespaces-- Returns:
- The HTML representation for this XMLSignature
- Throws:
XMLSignatureException
-
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.IOExceptionCanonicalizationException
-
setOutputStream
public void setOutputStream(java.io.OutputStream os)
- Parameters:
os-
-
getResetableInputStream
protected java.io.InputStream getResetableInputStream() throws java.io.IOException- Throws:
java.io.IOException
-
addNodeFilter
public void addNodeFilter(NodeFilter filter)
- Parameters:
filter-
-
getNodeFilters
public java.util.List getNodeFilters()
- Returns:
- the node filters
-
setNodeSet
public void setNodeSet(boolean b)
- Parameters:
b-
-
-