org.apache.xml.security.signature
Class XMLSignatureInput

java.lang.Object
  |
  +--org.apache.xml.security.signature.XMLSignatureInput

public class XMLSignatureInput
extends java.lang.Object

Class XMLSignatureInput

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

Nested Class Summary
 class XMLSignatureInput.XMLSignatureInputDebugger
          Class XMLSignatureInputDebugger
 
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(org.w3c.dom.Node rootNode, org.apache.xpath.CachedXPathAPI usedXPathAPI)
          Construct a XMLSignatureInput from a subtree rooted by rootNode.
XMLSignatureInput(org.w3c.dom.NodeList inputNodeSet)
          Deprecated. Use Sets instead of NodeLists.
XMLSignatureInput(org.w3c.dom.NodeList inputNodeSet, org.apache.xpath.CachedXPathAPI usedXPathAPI)
          Deprecated. Use Sets instead of NodeLists.
XMLSignatureInput(java.util.Set inputNodeSet)
          Constructor XMLSignatureInput
XMLSignatureInput(java.util.Set inputNodeSet, org.apache.xpath.CachedXPathAPI usedXPathAPI)
          Constructor XMLSignatureInput
XMLSignatureInput(java.lang.String inputStr)
          Construct a XMLSignatureInput from a String.
XMLSignatureInput(java.lang.String inputStr, java.lang.String encoding)
          Construct a XMLSignatureInput from a String with a given encoding.
 
Method Summary
 byte[] getBytes()
          Returns the byte array from input which was specified as the parameter of XMLSignatureInput constructor
 org.apache.xpath.CachedXPathAPI getCachedXPathAPI()
          This method gives access to an CachedXPathAPI object which was used for creating the internal node set and which MUST be used for subsequent operations on this node set.
 java.lang.String getHTMLRepresentation()
          Method getHTMLRepresentation
 java.lang.String getHTMLRepresentation(java.util.Set inclusiveNamespaces)
          Method getHTMLRepresentation
 java.lang.String getMIMEType()
          Returns MIMEType
 java.util.Set getNodeSet()
          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.lang.String getSourceURI()
          Return SourceURI
 boolean isInitialized()
          Is the object correctly set up?
 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
 void setMIMEType(java.lang.String MIMEType)
          Sets MIMEType
 void setSourceURI(java.lang.String SourceURI)
          Sets SourceURI
 java.lang.String toString()
          Method toString
 
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

Parameters:
inputOctets - an octet array which including XML document or node

XMLSignatureInput

public XMLSignatureInput(java.io.InputStream inputOctetStream)
                  throws java.io.IOException
Constructs a XMLSignatureInput from an octet stream. The stream is directly read.

Parameters:
inputOctetStream -
Throws:
java.io.IOException

XMLSignatureInput

public XMLSignatureInput(java.lang.String inputStr)
Construct a XMLSignatureInput from a String.

This is a comfort method, which internally converts the String into a byte[] array using the String.getBytes(int, int, byte[], int) 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
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(int, int, byte[], int) 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,
                         org.apache.xpath.CachedXPathAPI usedXPathAPI)
                  throws javax.xml.transform.TransformerException
Construct a XMLSignatureInput from a subtree rooted by rootNode. This method included the node and all his descendants in the output.

Parameters:
rootNode -
usedXPathAPI -
Throws:
javax.xml.transform.TransformerException

XMLSignatureInput

public XMLSignatureInput(org.w3c.dom.Node rootNode)
                  throws javax.xml.transform.TransformerException
Construct a XMLSignatureInput from a subtree rooted by rootNode. This method included the node and all his descendants in the output.

Parameters:
rootNode -
Throws:
javax.xml.transform.TransformerException

XMLSignatureInput

public XMLSignatureInput(java.util.Set inputNodeSet,
                         org.apache.xpath.CachedXPathAPI usedXPathAPI)
Constructor XMLSignatureInput

Parameters:
inputNodeSet -
usedXPathAPI -

XMLSignatureInput

public XMLSignatureInput(java.util.Set inputNodeSet)
Constructor XMLSignatureInput

Parameters:
inputNodeSet -

XMLSignatureInput

public XMLSignatureInput(org.w3c.dom.NodeList inputNodeSet)
Deprecated. Use Sets instead of NodeLists.

Constructor XMLSignatureInput

Parameters:
inputNodeSet -

XMLSignatureInput

public XMLSignatureInput(org.w3c.dom.NodeList inputNodeSet,
                         org.apache.xpath.CachedXPathAPI usedXPathAPI)
Deprecated. Use Sets instead of NodeLists.

Constructor XMLSignatureInput

Parameters:
inputNodeSet -
usedXPathAPI -
Method Detail

getNodeSet

public java.util.Set getNodeSet()
                         throws javax.xml.parsers.ParserConfigurationException,
                                java.io.IOException,
                                org.xml.sax.SAXException,
                                CanonicalizationException,
                                InvalidCanonicalizerException
Returns the node set from input which was specified as the parameter of XMLSignatureInput constructor

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

getOctetStream

public java.io.InputStream getOctetStream()
                                   throws java.io.IOException,
                                          CanonicalizationException,
                                          InvalidCanonicalizerException
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:
CanonicalizationException
java.io.IOException
InvalidCanonicalizerException

getBytes

public byte[] getBytes()
                throws java.io.IOException,
                       CanonicalizationException,
                       InvalidCanonicalizerException
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
InvalidCanonicalizerException

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

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

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 -

getCachedXPathAPI

public org.apache.xpath.CachedXPathAPI getCachedXPathAPI()
This method gives access to an CachedXPathAPI object which was used for creating the internal node set and which MUST be used for subsequent operations on this node set.

Returns:
an existing CachedXPathAPI

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

Throws:
XMLSignatureException

getHTMLRepresentation

public java.lang.String getHTMLRepresentation(java.util.Set inclusiveNamespaces)
                                       throws XMLSignatureException
Method getHTMLRepresentation

Parameters:
inclusiveNamespaces -
Throws:
XMLSignatureException