org.apache.xml.security.signature
Class XMLSignatureInput

java.lang.Object
  extended by org.apache.xml.security.signature.XMLSignatureInput
All Implemented Interfaces:
java.lang.Cloneable

public class XMLSignatureInput
extends java.lang.Object
implements java.lang.Cloneable

Class XMLSignatureInput

Author:
Christian Geuer-Pollmann $todo$ check whether an XMLSignatureInput can be _both_, octet stream _and_ node set?

Constructor Summary
XMLSignatureInput(byte[] inputOctets)
          Construct a XMLSignatureInput from an octet array.
XMLSignatureInput(java.io.InputStream inputOctetStream)
          Constructs a XMLSignatureInput from an octet stream.
XMLSignatureInput(org.w3c.dom.Node rootNode)
          Construct a XMLSignatureInput from a subtree rooted by rootNode.
XMLSignatureInput(java.util.Set inputNodeSet)
          Constructor XMLSignatureInput
XMLSignatureInput(java.lang.String inputStr)
          Deprecated.  
XMLSignatureInput(java.lang.String inputStr, java.lang.String encoding)
          Deprecated.  
 
Method Summary
 void addNodeFilter(NodeFilter filter)
           
 byte[] getBytes()
          Returns the byte array from input which was specified as the parameter of XMLSignatureInput constructor
 org.w3c.dom.Node getExcludeNode()
          Gets the exclude node of this XMLSignatureInput
 java.lang.String getHTMLRepresentation()
          Method getHTMLRepresentation
 java.lang.String getHTMLRepresentation(java.util.Set inclusiveNamespaces)
          Method getHTMLRepresentation
 java.lang.String getMIMEType()
          Returns MIMEType
 java.util.List getNodeFilters()
           
 java.util.Set getNodeSet()
          Returns the node set from input which was specified as the parameter of XMLSignatureInput constructor
 java.util.Set getNodeSet(boolean circumvent)
          Returns the node set from input which was specified as the parameter of XMLSignatureInput constructor
 java.io.InputStream getOctetStream()
          Returns the Octect stream(byte Stream) from input which was specified as the parameter of XMLSignatureInput constructor
 java.io.InputStream getOctetStreamReal()
           
protected  java.io.InputStream getResetableInputStream()
           
 java.lang.String getSourceURI()
          Return SourceURI
 org.w3c.dom.Node getSubNode()
          Gets the node of this XMLSignatureInput
 boolean isByteArray()
          Determines if the object has been set up with a ByteArray
 boolean isElement()
          Determines if the object has been set up with an Element
 boolean 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 set
 boolean isOctetStream()
          Determines if the object has been set up with an octet stream
 boolean isOutputStreamSet()
          Determines if setOutputStream(java.io.OutputStream) has been called with a non-null OutputStream.
 void setExcludeComments(boolean excludeComments)
           
 void setExcludeNode(org.w3c.dom.Node excludeNode)
          Sets the exclude node of this XMLSignatureInput
 void setMIMEType(java.lang.String MIMEType)
          Sets MIMEType
 void setNeedsToBeExpanded(boolean needsToBeExpanded)
          Set if the structure needs to be expanded.
 void setNodeSet(boolean b)
           
 void setOutputStream(java.io.OutputStream os)
           
 void setSourceURI(java.lang.String SourceURI)
          Sets SourceURI
 java.lang.String toString()
          Method toString
 void updateOutputStream(java.io.OutputStream diOs)
           
 void updateOutputStream(java.io.OutputStream diOs, boolean c14n11)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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 a XMLSignatureInput from 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.UnsupportedEncodingException
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 encoding encoding
encoding - the encoding of inputStr
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 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 getNodeSet()
                         throws CanonicalizationException,
                                javax.xml.parsers.ParserConfigurationException,
                                java.io.IOException,
                                org.xml.sax.SAXException
Returns the node set from input which was specified as the parameter of XMLSignatureInput constructor

Returns:
the node set
Throws:
org.xml.sax.SAXException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
CanonicalizationException

getNodeSet

public java.util.Set getNodeSet(boolean circumvent)
                         throws javax.xml.parsers.ParserConfigurationException,
                                java.io.IOException,
                                org.xml.sax.SAXException,
                                CanonicalizationException
Returns the node set from input which was specified as the parameter of XMLSignatureInput 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.IOException
Returns the Octect stream(byte Stream) from input which was specified as the parameter of XMLSignatureInput constructor

Returns:
the Octect 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 octect stream

getBytes

public byte[] getBytes()
                throws java.io.IOException,
                       CanonicalizationException
Returns the byte array from input which was specified as the parameter of XMLSignatureInput 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 a Node set

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 if setOutputStream(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 class java.lang.Object

getHTMLRepresentation

public java.lang.String getHTMLRepresentation()
                                       throws XMLSignatureException
Method getHTMLRepresentation

Returns:
The HTML representation for this XMLSignature
Throws:
XMLSignatureException

getHTMLRepresentation

public java.lang.String getHTMLRepresentation(java.util.Set inclusiveNamespaces)
                                       throws XMLSignatureException
Method 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.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 -

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 -


Copyright © 2000-2014 The Apache Software Foundation. All Rights Reserved.