org.apache.xml.security.signature
Class XMLSignatureInput

java.lang.Object
  extended by org.apache.xml.security.signature.XMLSignatureInput

public class XMLSignatureInput
extends Object

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(InputStream inputOctetStream)
          Constructs a XMLSignatureInput from an octet stream.
XMLSignatureInput(Node rootNode)
          Construct a XMLSignatureInput from a subtree rooted by rootNode.
XMLSignatureInput(Set<Node> inputNodeSet)
          Constructor XMLSignatureInput
 
Method Summary
 void addNodeFilter(NodeFilter filter)
           
 byte[] getBytes()
          Returns the byte array from input which was specified as the parameter of XMLSignatureInput constructor
 Node getExcludeNode()
          Gets the exclude node of this XMLSignatureInput
 String getHTMLRepresentation()
          Method getHTMLRepresentation
 String getHTMLRepresentation(Set<String> inclusiveNamespaces)
          Method getHTMLRepresentation
 Set<Node> getInputNodeSet()
          Get the Input NodeSet.
 String getMIMEType()
          Returns mimeType
 List<NodeFilter> getNodeFilters()
           
 Set<Node> getNodeSet()
          Returns the node set from input which was specified as the parameter of XMLSignatureInput constructor
 Set<Node> getNodeSet(boolean circumvent)
          Returns the node set from input which was specified as the parameter of XMLSignatureInput constructor
 InputStream getOctetStream()
          Returns the Octet stream(byte Stream) from input which was specified as the parameter of XMLSignatureInput constructor
 InputStream getOctetStreamReal()
           
 String getSourceURI()
          Return SourceURI
 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.
 boolean isSecureValidation()
           
 void setExcludeComments(boolean excludeComments)
           
 void setExcludeNode(Node excludeNode)
          Sets the exclude node of this XMLSignatureInput
 void setMIMEType(String mimeType)
          Sets mimeType
 void setNeedsToBeExpanded(boolean needsToBeExpanded)
          Set if the structure needs to be expanded.
 void setNodeSet(boolean b)
           
 void setOutputStream(OutputStream os)
           
 void setSecureValidation(boolean secureValidation)
           
 void setSourceURI(String sourceURI)
          Sets SourceURI
 String toString()
          Method toString
 void updateOutputStream(OutputStream diOs)
           
 void updateOutputStream(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(InputStream inputOctetStream)
Constructs a XMLSignatureInput from an octet stream. The stream is directly read.

Parameters:
inputOctetStream -

XMLSignatureInput

public XMLSignatureInput(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(Set<Node> inputNodeSet)
Constructor XMLSignatureInput

Parameters:
inputNodeSet -
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 Set<Node> getNodeSet()
                     throws CanonicalizationException,
                            ParserConfigurationException,
                            IOException,
                            SAXException
Returns the node set from input which was specified as the parameter of XMLSignatureInput constructor

Returns:
the node set
Throws:
SAXException
IOException
ParserConfigurationException
CanonicalizationException

getInputNodeSet

public Set<Node> getInputNodeSet()
Get the Input NodeSet.

Returns:
the Input NodeSet.

getNodeSet

public Set<Node> getNodeSet(boolean circumvent)
                     throws ParserConfigurationException,
                            IOException,
                            SAXException,
                            CanonicalizationException
Returns the node set from input which was specified as the parameter of XMLSignatureInput constructor

Parameters:
circumvent -
Returns:
the node set
Throws:
SAXException
IOException
ParserConfigurationException
CanonicalizationException

getOctetStream

public InputStream getOctetStream()
                           throws IOException
Returns the Octet stream(byte Stream) from input which was specified as the parameter of XMLSignatureInput constructor

Returns:
the Octet stream(byte Stream) from input which was specified as the parameter of XMLSignatureInput constructor
Throws:
IOException

getOctetStreamReal

public InputStream getOctetStreamReal()
Returns:
real octet stream

getBytes

public byte[] getBytes()
                throws 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
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 an Element

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 String getMIMEType()
Returns mimeType

Returns:
mimeType

setMIMEType

public void setMIMEType(String mimeType)
Sets mimeType

Parameters:
mimeType -

getSourceURI

public String getSourceURI()
Return SourceURI

Returns:
SourceURI

setSourceURI

public void setSourceURI(String sourceURI)
Sets SourceURI

Parameters:
sourceURI -

toString

public String toString()
Method toString

Overrides:
toString in class Object

getHTMLRepresentation

public String getHTMLRepresentation()
                             throws XMLSignatureException
Method getHTMLRepresentation

Returns:
The HTML representation for this XMLSignature
Throws:
XMLSignatureException

getHTMLRepresentation

public String getHTMLRepresentation(Set<String> inclusiveNamespaces)
                             throws XMLSignatureException
Method getHTMLRepresentation

Parameters:
inclusiveNamespaces -
Returns:
The HTML representation for this XMLSignature
Throws:
XMLSignatureException

getExcludeNode

public Node getExcludeNode()
Gets the exclude node of this XMLSignatureInput

Returns:
Returns the excludeNode.

setExcludeNode

public void setExcludeNode(Node excludeNode)
Sets the exclude node of this XMLSignatureInput

Parameters:
excludeNode - The excludeNode to set.

getSubNode

public 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(OutputStream diOs)
                        throws CanonicalizationException,
                               IOException
Parameters:
diOs -
Throws:
IOException
CanonicalizationException

updateOutputStream

public void updateOutputStream(OutputStream diOs,
                               boolean c14n11)
                        throws CanonicalizationException,
                               IOException
Throws:
CanonicalizationException
IOException

setOutputStream

public void setOutputStream(OutputStream os)
Parameters:
os -

addNodeFilter

public void addNodeFilter(NodeFilter filter)
Parameters:
filter -

getNodeFilters

public List<NodeFilter> getNodeFilters()
Returns:
the node filters

setNodeSet

public void setNodeSet(boolean b)
Parameters:
b -

isSecureValidation

public boolean isSecureValidation()

setSecureValidation

public void setSecureValidation(boolean secureValidation)


Copyright © 2000–2014 The Apache Software Foundation. All rights reserved.