Class XMLSignatureInput

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected XMLSignatureInput()
      Construct a XMLSignatureInput
      protected XMLSignatureInput​(java.util.Set<org.w3c.dom.Node> nodeSet)
      Construct a XMLSignatureInput from a Set of Nodes.
      protected XMLSignatureInput​(org.w3c.dom.Node rootNode)
      Construct a XMLSignatureInput from a subtree rooted by rootNode.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void addNodeFilter​(NodeFilter filter)  
      protected void canonicalize​(java.io.OutputStream output, boolean c14n11)
      Canonicalizes this object to the output stream.
      protected abstract org.w3c.dom.Node convertToNode()  
      byte[] getBytes()
      Returns the byte array from input which was specified as the parameter of XMLSignatureInput constructor OR tries to reconstruct that if the element or node was already processed.
      org.w3c.dom.Node getExcludeNode()  
      java.util.Set<org.w3c.dom.Node> getInputNodeSet()
      Get the Input NodeSet.
      java.lang.String getMIMEType()
      Some Transforms may require explicit MIME type, charset (IANA registered "character set"), or other such information concerning the data they are receiving from an earlier Transform or the source data, although no Transform algorithm specified in this document needs such explicit information.
      java.util.List<NodeFilter> getNodeFilters()  
      java.util.Set<org.w3c.dom.Node> getNodeSet()
      Returns the node set from input which was specified as the parameter of XMLSignatureInput constructor
      private java.util.Set<org.w3c.dom.Node> getNodeSet​(boolean circumvent)
      Returns the node set from input which was specified as the parameter of XMLSignatureInput constructor
      java.io.OutputStream getOutputStream()  
      java.lang.String getPreCalculatedDigest()  
      java.lang.String getSourceURI()  
      org.w3c.dom.Node getSubNode()
      Gets the node of this XMLSignatureInput
      abstract java.io.InputStream getUnprocessedInput()  
      abstract boolean hasUnprocessedInput()  
      boolean isElement()
      Determines if the object has been set up with an Element
      boolean isExcludeComments()  
      boolean isNeedsToBeExpanded()  
      boolean isNodeSet()  
      boolean isOutputStreamSet()  
      boolean isSecureValidation()  
      void setExcludeComments​(boolean excludeComments)  
      void setExcludeNode​(org.w3c.dom.Node excludeNode)
      Sets the exclude node of this XMLSignatureInput
      void setMIMEType​(java.lang.String mimeType)
      Some Transforms may require explicit MIME type, charset (IANA registered "character set"), or other such information concerning the data they are receiving from an earlier Transform or the source data, although no Transform algorithm specified in this document needs such explicit information.
      void setNeedsToBeExpanded​(boolean needsToBeExpanded)
      Set if the structure needs to be expanded.
      void setNodeSet​(boolean nodeSet)  
      void setOutputStream​(java.io.OutputStream outputStream)  
      void setSecureValidation​(boolean secureValidation)
      Set to false to disable validation in r/w operations.
      void setSourceURI​(java.lang.String sourceURI)  
      java.lang.String toString()
      Creates a short description of this instance.
      void write​(java.io.OutputStream output)
      Writes the data to the output stream.
      abstract void write​(java.io.OutputStream output, boolean c14n11)
      Writes the data to the output stream.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • inputNodeSet

        private java.util.Set<org.w3c.dom.Node> inputNodeSet
        The original set from the constructor.
      • subNode

        private org.w3c.dom.Node subNode
        The original Element
      • isNodeSet

        private boolean isNodeSet
      • nodeFilters

        private final java.util.List<NodeFilter> nodeFilters
        Node Filter list.
      • excludeNode

        private org.w3c.dom.Node excludeNode
        Exclude Node *for enveloped transformations
      • excludeComments

        private boolean excludeComments
      • sourceURI

        private java.lang.String sourceURI
      • mimeType

        private java.lang.String mimeType
      • needsToBeExpanded

        private boolean needsToBeExpanded
      • secureValidation

        private boolean secureValidation
      • outputStream

        private java.io.OutputStream outputStream
    • Constructor Detail

      • XMLSignatureInput

        protected XMLSignatureInput()
        Construct a XMLSignatureInput
      • XMLSignatureInput

        protected XMLSignatureInput​(org.w3c.dom.Node rootNode)
        Construct a XMLSignatureInput from a subtree rooted by rootNode. This method included the node and all its descendants in the output.
        Parameters:
        rootNode -
      • XMLSignatureInput

        protected XMLSignatureInput​(java.util.Set<org.w3c.dom.Node> nodeSet)
        Construct a XMLSignatureInput from a Set of Nodes.
        Parameters:
        nodeSet -
    • Method Detail

      • hasUnprocessedInput

        public abstract boolean hasUnprocessedInput()
        Returns:
        true if this instance still can provide the unprocessed input which was specified as the parameter of XMLSignatureInput
      • getUnprocessedInput

        public abstract java.io.InputStream getUnprocessedInput()
                                                         throws java.io.IOException
        Returns:
        the InputStream from input which was specified as the parameter of XMLSignatureInput constructor
        Throws:
        java.io.IOException
      • convertToNode

        protected abstract org.w3c.dom.Node convertToNode()
                                                   throws XMLParserException,
                                                          java.io.IOException
        Returns:
        data given in constructor converted to a Node or null if such conversion is not supported by this XMLSignatureInput
        Throws:
        XMLParserException
        java.io.IOException
      • getInputNodeSet

        public java.util.Set<org.w3c.dom.Node> getInputNodeSet()
        Get the Input NodeSet.
        Returns:
        the Input NodeSet.
      • getNodeSet

        public java.util.Set<org.w3c.dom.Node> getNodeSet()
                                                   throws XMLParserException,
                                                          java.io.IOException
        Returns the node set from input which was specified as the parameter of XMLSignatureInput constructor

        Can call the convertToNode() to parse the Node from the input data. The internal state will change then.

        Returns:
        the node set
        Throws:
        XMLParserException
        java.io.IOException
      • getNodeSet

        private java.util.Set<org.w3c.dom.Node> getNodeSet​(boolean circumvent)
                                                    throws XMLParserException,
                                                           java.io.IOException
        Returns the node set from input which was specified as the parameter of XMLSignatureInput constructor

        Can call the convertToNode() to parse the Node from the input data. The internal state will change then.

        Parameters:
        circumvent -
        Returns:
        the node set
        Throws:
        XMLParserException
        java.io.IOException
      • getSubNode

        public org.w3c.dom.Node getSubNode()
        Gets the node of this XMLSignatureInput
        Returns:
        The excludeNode set.
      • getNodeFilters

        public final java.util.List<NodeFilter> getNodeFilters()
        Returns:
        the node filters
      • setNodeSet

        public final void setNodeSet​(boolean nodeSet)
        Parameters:
        nodeSet -
      • getBytes

        public byte[] getBytes()
                        throws java.io.IOException,
                               CanonicalizationException
        Returns the byte array from input which was specified as the parameter of XMLSignatureInput constructor OR tries to reconstruct that if the element or node was already processed.
        Returns:
        the byte array
        Throws:
        CanonicalizationException
        java.io.IOException
      • isNodeSet

        public boolean isNodeSet()
        Returns:
        true if the XMLSignatureInput(Set) was used or the node set was parsed from an input coming from another constructor.
      • 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
      • getPreCalculatedDigest

        public java.lang.String getPreCalculatedDigest()
        Returns:
        String given through constructor. Null by default, see extensions of this class.
      • getExcludeNode

        public org.w3c.dom.Node getExcludeNode()
        Returns:
        the exclude node of this XMLSignatureInput
      • setExcludeNode

        public void setExcludeNode​(org.w3c.dom.Node excludeNode)
        Sets the exclude node of this XMLSignatureInput
        Parameters:
        excludeNode - The excludeNode to set.
      • isExcludeComments

        public boolean isExcludeComments()
        Returns:
        Returns the excludeComments.
      • setExcludeComments

        public void setExcludeComments​(boolean excludeComments)
        Parameters:
        excludeComments - The excludeComments to set.
      • getSourceURI

        public java.lang.String getSourceURI()
        Returns:
        Source URI
      • setSourceURI

        public void setSourceURI​(java.lang.String sourceURI)
        Parameters:
        sourceURI -
      • getMIMEType

        public java.lang.String getMIMEType()
        Some Transforms may require explicit MIME type, charset (IANA registered "character set"), or other such information concerning the data they are receiving from an earlier Transform or the source data, although no Transform algorithm specified in this document needs such explicit information.

        Such data characteristics are provided as parameters to the Transform algorithm and should be described in the specification for the algorithm.

        Returns:
        mimeType
      • setMIMEType

        public void setMIMEType​(java.lang.String mimeType)
        Some Transforms may require explicit MIME type, charset (IANA registered "character set"), or other such information concerning the data they are receiving from an earlier Transform or the source data, although no Transform algorithm specified in this document needs such explicit information.

        Such data characteristics are provided as parameters to the Transform algorithm and should be described in the specification for the algorithm.

        Parameters:
        mimeType -
      • isNeedsToBeExpanded

        public boolean isNeedsToBeExpanded()
        Returns:
        true if the structure needs to be expanded.
      • setNeedsToBeExpanded

        public void setNeedsToBeExpanded​(boolean needsToBeExpanded)
        Set if the structure needs to be expanded.
        Parameters:
        needsToBeExpanded - true if so.
      • isSecureValidation

        public boolean isSecureValidation()
        Returns:
        true by default, enabled validation in r/w operations
      • setSecureValidation

        public void setSecureValidation​(boolean secureValidation)
        Set to false to disable validation in r/w operations.
        Parameters:
        secureValidation - default is true.
      • setOutputStream

        public void setOutputStream​(java.io.OutputStream outputStream)
        Parameters:
        outputStream - this stream will be ignored in write(OutputStream) method
      • toString

        public java.lang.String toString()
        Creates a short description of this instance.
        Overrides:
        toString in class java.lang.Object
      • canonicalize

        protected void canonicalize​(java.io.OutputStream output,
                                    boolean c14n11)
                             throws CanonicalizationException,
                                    java.io.IOException
        Canonicalizes this object to the output stream.
        Parameters:
        c14n11 -
        output -
        Throws:
        CanonicalizationException
        java.io.IOException