Class TimeStampFactory


  • public class TimeStampFactory
    extends java.lang.Object
    Factory class for interacting with Time Stamp Authority (TSA) services to obtain time stamps.
    • 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.TimeStampResponse getTimeStampResponse​(java.net.URI tsaUri, byte[] data, boolean calculateDigest)
      Creates a time stamp request, sends it to a TSA server, and processes the response.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TimeStampFactory

        public TimeStampFactory()
    • 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.TSPException
        Creates 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.URISyntaxException
        Obtains 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.