Class XMLSignatureInput
java.lang.Object
org.apache.xml.security.signature.XMLSignatureInput
Class XMLSignatureInput
$todo$ check whether an XMLSignatureInput can be _both_, octet stream _and_ node set?
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate byte[]A cached bytesprivate booleanprivate NodeExclude Node *for enveloped transformations*The original NodeSet for this XMLSignatureInputprivate InputStreamSome InputStreams do not support theInputStream.reset()method, so we read it in completely and work on our Proxy.private booleanprivate StringSome 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.private booleanprivate List<NodeFilter> Node Filter list.private OutputStreamprivate StringPre-calculated digest value of the object in base64.private booleanprivate StringField sourceURIprivate NodeThe original Element -
Constructor Summary
ConstructorsConstructorDescriptionXMLSignatureInput(byte[] inputOctets) Construct a XMLSignatureInput from an octet array.XMLSignatureInput(InputStream inputOctetStream) Constructs aXMLSignatureInputfrom an octet stream.XMLSignatureInput(String preCalculatedDigest) Construct aXMLSignatureInputfrom a known digest value in Base64.XMLSignatureInput(Set<Node> inputNodeSet) Constructor XMLSignatureInputXMLSignatureInput(Node rootNode) Construct a XMLSignatureInput from a subtree rooted by rootNode. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddNodeFilter(NodeFilter filter) (package private) voidbyte[]getBytes()Returns the byte array from input which was specified as the parameter ofXMLSignatureInputconstructorprivate byte[]Gets the exclude node of this XMLSignatureInputMethod getHTMLRepresentationgetHTMLRepresentation(Set<String> inclusiveNamespaces) Method getHTMLRepresentationGet the Input NodeSet.Returns mimeTypeReturns the node set from input which was specified as the parameter ofXMLSignatureInputconstructorgetNodeSet(boolean circumvent) Returns the node set from input which was specified as the parameter ofXMLSignatureInputconstructorReturns the Octet stream(byte Stream) from input which was specified as the parameter ofXMLSignatureInputconstructorReturn SourceURIGets the node of this XMLSignatureInputbooleanDetermines if the object has been set up with a ByteArraybooleanDetermines if the object has been set up with an ElementbooleanbooleanIs the object correctly set up?booleanCheck if the structure needs to be expanded.booleanDetermines if the object has been set up with a Node setbooleanDetermines if the object has been set up with an octet streambooleanDetermines ifsetOutputStream(OutputStream)has been called with a non-null OutputStream.booleanDetermines if the object has been set up with a pre-calculated digest.booleanvoidsetExcludeComments(boolean excludeComments) voidsetExcludeNode(Node excludeNode) Sets the exclude node of this XMLSignatureInputvoidsetMIMEType(String mimeType) Sets mimeTypevoidsetNeedsToBeExpanded(boolean needsToBeExpanded) Set if the structure needs to be expanded.voidsetNodeSet(boolean b) voidvoidsetSecureValidation(boolean secureValidation) voidsetSourceURI(String sourceURI) Sets SourceURItoString()Method toStringvoidvoidupdateOutputStream(OutputStream diOs, boolean c14n11)
-
Field Details
-
inputOctetStreamProxy
Some InputStreams do not support theInputStream.reset()method, so we read it in completely and work on our Proxy. -
inputNodeSet
-
subNode
The original Element -
excludeNode
Exclude Node *for enveloped transformations* -
excludeComments
private boolean excludeComments -
isNodeSet
private boolean isNodeSet -
bytes
private byte[] bytesA cached bytes -
secureValidation
private boolean secureValidation -
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. -
sourceURI
Field sourceURI -
nodeFilters
Node Filter list. -
needsToBeExpanded
private boolean needsToBeExpanded -
outputStream
-
preCalculatedDigest
Pre-calculated digest value of the object in base64.
-
-
Constructor Details
-
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
Constructs aXMLSignatureInputfrom an octet stream. The stream is directly read.- Parameters:
inputOctetStream-
-
XMLSignatureInput
Construct a XMLSignatureInput from a subtree rooted by rootNode. This method included the node and all his descendants in the output.- Parameters:
rootNode-
-
XMLSignatureInput
-
XMLSignatureInput
Construct aXMLSignatureInputfrom a known digest value in Base64. This makes it possible to compare the element digest with the provided digest value.- Parameters:
preCalculatedDigest- digest value in base64.
-
-
Method Details
-
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, SAXExceptionReturns the node set from input which was specified as the parameter ofXMLSignatureInputconstructor- Returns:
- the node set
- Throws:
SAXExceptionIOExceptionParserConfigurationExceptionCanonicalizationException
-
getInputNodeSet
-
getNodeSet
public Set<Node> getNodeSet(boolean circumvent) throws ParserConfigurationException, IOException, SAXException, CanonicalizationException Returns the node set from input which was specified as the parameter ofXMLSignatureInputconstructor- Parameters:
circumvent-- Returns:
- the node set
- Throws:
SAXExceptionIOExceptionParserConfigurationExceptionCanonicalizationException
-
getOctetStream
Returns the Octet stream(byte Stream) from input which was specified as the parameter ofXMLSignatureInputconstructor- Returns:
- the Octet stream(byte Stream) from input which was specified as
the parameter of
XMLSignatureInputconstructor - Throws:
IOException
-
getOctetStreamReal
- Returns:
- real octet stream
-
getBytes
Returns 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:
CanonicalizationExceptionIOException
-
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 ifsetOutputStream(OutputStream)has been called with a non-null OutputStream.- Returns:
- true if
setOutputStream(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
-
isPreCalculatedDigest
public boolean isPreCalculatedDigest()Determines if the object has been set up with a pre-calculated digest.- Returns:
-
isInitialized
public boolean isInitialized()Is the object correctly set up?- Returns:
- true if the object has been set up correctly
-
getMIMEType
-
setMIMEType
-
getSourceURI
-
setSourceURI
-
toString
-
getHTMLRepresentation
Method getHTMLRepresentation- Returns:
- The HTML representation for this XMLSignature
- Throws:
XMLSignatureException
-
getHTMLRepresentation
Method getHTMLRepresentation- Parameters:
inclusiveNamespaces-- Returns:
- The HTML representation for this XMLSignature
- Throws:
XMLSignatureException
-
getExcludeNode
Gets the exclude node of this XMLSignatureInput- Returns:
- Returns the excludeNode.
-
setExcludeNode
Sets the exclude node of this XMLSignatureInput- Parameters:
excludeNode- The excludeNode to set.
-
getSubNode
-
isExcludeComments
public boolean isExcludeComments()- Returns:
- Returns the excludeComments.
-
setExcludeComments
public void setExcludeComments(boolean excludeComments) - Parameters:
excludeComments- The excludeComments to set.
-
updateOutputStream
- Parameters:
diOs-- Throws:
IOExceptionCanonicalizationException
-
updateOutputStream
public void updateOutputStream(OutputStream diOs, boolean c14n11) throws CanonicalizationException, IOException - Throws:
CanonicalizationExceptionIOException
-
setOutputStream
- Parameters:
os-
-
getBytesFromInputStream
- Throws:
IOException
-
addNodeFilter
- Parameters:
filter-
-
getNodeFilters
- Returns:
- the node filters
-
setNodeSet
public void setNodeSet(boolean b) - Parameters:
b-
-
convertToNodes
void convertToNodes() throws CanonicalizationException, ParserConfigurationException, IOException, SAXException -
isSecureValidation
public boolean isSecureValidation() -
setSecureValidation
public void setSecureValidation(boolean secureValidation) -
getPreCalculatedDigest
-