Class UtilsTimestampWS


  • public final class UtilsTimestampWS
    extends java.lang.Object

    Class that contains methods related to the manage of timestamps.

    Project:

    Library for the integration with the services of @Firma, eVisor and TS@.

    Version:
    1.3, 18/04/2022.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static Logger LOGGER
      Attribute that represents the object that manages the log of the class.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void checkInputDocumentRFC3161TimeStamp​(org.w3c.dom.Element inputDocuments, org.bouncycastle.tsp.TimeStampToken tst)
      Method that checks if the input document associated to a renovation of a RFC 3161 time-stamp is structurally correct.
      static void checkInputDocumentXMLTimeStamp​(org.w3c.dom.Element inputDocuments, org.w3c.dom.Element signature)
      Method that checks if the input document associated to a renovation of a XML time-stamp is structurally correct.
      static java.lang.Object getTimestampFromDssService​(byte[] dataToStamp, java.lang.String applicationID, java.lang.String signatureType)
      Method that obtains a timestamp from TS@.
      static java.lang.Object getTimestampFromDssService​(byte[] dataToStamp, java.lang.String applicationID, java.lang.String signatureType, java.lang.String idClient)
      Method that obtains a timestamp from TS@.
      • Methods inherited from class java.lang.Object

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

      • LOGGER

        public static final Logger LOGGER
        Attribute that represents the object that manages the log of the class.
    • Method Detail

      • getTimestampFromDssService

        public static java.lang.Object getTimestampFromDssService​(byte[] dataToStamp,
                                                                  java.lang.String applicationID,
                                                                  java.lang.String signatureType)
                                                           throws SigningException
        Method that obtains a timestamp from TS@.
        Parameters:
        dataToStamp - Parameter that represents the data to stamp.
        applicationID - Parameter that represents the identifier of the client application.
        signatureType - Parameter that represents the timestamp type to generate. The allowed values are:
        Returns:
        an object that represents the timestamp. This object can be:
        • An instance of TimeStampToken when the timestamp is ASN.1 type.
        • An instance of Element when the timestamp is XML type.
        Throws:
        SigningException - If the method fails.
      • getTimestampFromDssService

        public static java.lang.Object getTimestampFromDssService​(byte[] dataToStamp,
                                                                  java.lang.String applicationID,
                                                                  java.lang.String signatureType,
                                                                  java.lang.String idClient)
                                                           throws SigningException
        Method that obtains a timestamp from TS@.
        Parameters:
        dataToStamp - Parameter that represents the data to stamp.
        applicationID - Parameter that represents the identifier of the client application.
        signatureType - Parameter that represents the timestamp type to generate. The allowed values are:
        idClient - Parameter that represents client id.
        Returns:
        an object that represents the timestamp. This object can be:
        • An instance of TimeStampToken when the timestamp is ASN.1 type.
        • An instance of Element when the timestamp is XML type.
        Throws:
        SigningException - If the method fails.
      • checkInputDocumentXMLTimeStamp

        public static void checkInputDocumentXMLTimeStamp​(org.w3c.dom.Element inputDocuments,
                                                          org.w3c.dom.Element signature)
                                                   throws TSAServiceInvokerException
        Method that checks if the input document associated to a renovation of a XML time-stamp is structurally correct.
        Parameters:
        inputDocuments - Parameter that represents the dss:InputDocuments element of the time-stamp renovation request.
        signature - Parameter that represents the ds:Signature element of the time-stamp renovation request.
        Throws:
        TSAServiceInvokerException - If the validation fails.
      • checkInputDocumentRFC3161TimeStamp

        public static void checkInputDocumentRFC3161TimeStamp​(org.w3c.dom.Element inputDocuments,
                                                              org.bouncycastle.tsp.TimeStampToken tst)
                                                       throws TSAServiceInvokerException
        Method that checks if the input document associated to a renovation of a RFC 3161 time-stamp is structurally correct.
        Parameters:
        inputDocuments - Parameter that represents the dss:InputDocuments element of the time-stamp renovation request.
        tst - Parameter that represents thr RFC 3161 time-stamp.
        Throws:
        TSAServiceInvokerException - If the input document isn't valid.