Class TimeStampFactory
- java.lang.Object
-
- net.java.xades.security.timestamp.TimeStampFactory
-
public class TimeStampFactory extends java.lang.ObjectFactory class for interacting with Time Stamp Authority (TSA) services to obtain time stamps.
-
-
Constructor Summary
Constructors Constructor Description TimeStampFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]getTimeStamp(java.lang.String tsaURL, byte[] data, boolean calculateDigest)Obtains a time stamp for the given data from the specified TSA server.static org.bouncycastle.tsp.TimeStampResponsegetTimeStampResponse(java.net.URI tsaUri, byte[] data, boolean calculateDigest)Creates a time stamp request, sends it to a TSA server, and processes the response.
-
-
-
Method Detail
-
getTimeStampResponse
public static org.bouncycastle.tsp.TimeStampResponse getTimeStampResponse(java.net.URI tsaUri, byte[] data, boolean calculateDigest) throws java.security.NoSuchAlgorithmException, java.io.IOException, org.bouncycastle.tsp.TSPExceptionCreates a time stamp request, sends it to a TSA server, and processes the response.- Parameters:
tsaUri- The URI of the TSA server.data- The data to be time-stamped.calculateDigest- If true, a digest of the data will be calculated before the request.- Returns:
- The TSA response containing the time stamp token.
- Throws:
java.security.NoSuchAlgorithmException- If the specified algorithm is not available.java.io.IOException- If an I/O error occurs during communication with the TSA server.org.bouncycastle.tsp.TSPException- If there is an error processing the TSA response.
-
getTimeStamp
public static byte[] getTimeStamp(java.lang.String tsaURL, byte[] data, boolean calculateDigest) throws java.security.NoSuchAlgorithmException, java.io.IOException, org.bouncycastle.tsp.TSPException, java.net.URISyntaxExceptionObtains a time stamp for the given data from the specified TSA server.- Parameters:
tsaURL- The URL of the TSA server.data- The data to be time-stamped.calculateDigest- If true, a digest of the data will be calculated before the request.- Returns:
- The time stamp in binary format.
- Throws:
java.security.NoSuchAlgorithmException- If the specified algorithm is not available.java.io.IOException- If an I/O error occurs during communication with the TSA server.org.bouncycastle.tsp.TSPException- If there is an error processing the TSA response.java.net.URISyntaxException- If the TSA URL is invalid.
-
-