xades4j.utils
Class TimeStampDigestInput

java.lang.Object
  extended by xades4j.utils.TimeStampDigestInput

public class TimeStampDigestInput
extends Object

Helper class to build inputs for time-stamps. The digests for time-stamps are usually calculated over a concatenations of byte-streams, resulting from nodes and/or processed References, with the proper canonicalization if needed. This class provides methods to build a sequential input by adding DOM Nodes or References.

Author:
Luís

Constructor Summary
TimeStampDigestInput(String canonMethodUri)
           
 
Method Summary
 void addNode(Node n)
          Adds a Node to the input.
 void addReference(org.apache.xml.security.signature.Reference r)
          Adds a Reference to the input.
 byte[] getBytes()
          Gets the octet-stream corresponding to the actual state of the input.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeStampDigestInput

public TimeStampDigestInput(String canonMethodUri)
Parameters:
canonMethodUri - the canonicalization method to be used, if needed
Throws:
NullPointerException - if canonMethodUri is null
Method Detail

addReference

public void addReference(org.apache.xml.security.signature.Reference r)
                  throws CannotAddDataToDigestInputException
Adds a Reference to the input. It is processed and the result is canonicalized if it is a node-set.

Parameters:
r - the reference to be added
Throws:
CannotAddDataToDigestInputException - if there is an error adding the reference
NullPointerException - if r is null

addNode

public void addNode(Node n)
             throws CannotAddDataToDigestInputException
Adds a Node to the input. The node is canonicalized.

Parameters:
n - the node to be added
Throws:
CannotAddDataToDigestInputException - if there is an error adding the node
NullPointerException - if n is null

getBytes

public byte[] getBytes()
Gets the octet-stream corresponding to the actual state of the input.

Returns:
the octet-stream (always a new instance)


Copyright © 2012. All Rights Reserved.