Package es.gob.afirma.utils
Class UtilsTimestampWS
- java.lang.Object
-
- es.gob.afirma.utils.UtilsTimestampWS
-
public final class UtilsTimestampWS extends java.lang.ObjectClass 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.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcheckInputDocumentRFC3161TimeStamp(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 voidcheckInputDocumentXMLTimeStamp(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.ObjectgetTimestampFromDssService(byte[] dataToStamp, java.lang.String applicationID, java.lang.String signatureType)Method that obtains a timestamp from TS@.static java.lang.ObjectgetTimestampFromDssService(byte[] dataToStamp, java.lang.String applicationID, java.lang.String signatureType, java.lang.String idClient)Method that obtains a timestamp from TS@.
-
-
-
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 SigningExceptionMethod 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:DSSConstants.TimestampForm.RFC_3161for ASN.1 timestamp.DSSConstants.TimestampForm.XMLfor XML timestamp.
- Returns:
- an object that represents the timestamp. This object can be:
- An instance of
TimeStampTokenwhen the timestamp is ASN.1 type. - An instance of
Elementwhen the timestamp is XML type.
- An instance of
- 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 SigningExceptionMethod 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:DSSConstants.TimestampForm.RFC_3161for ASN.1 timestamp.DSSConstants.TimestampForm.XMLfor XML timestamp.
idClient- Parameter that represents client id.- Returns:
- an object that represents the timestamp. This object can be:
- An instance of
TimeStampTokenwhen the timestamp is ASN.1 type. - An instance of
Elementwhen the timestamp is XML type.
- An instance of
- Throws:
SigningException- If the method fails.
-
checkInputDocumentXMLTimeStamp
public static void checkInputDocumentXMLTimeStamp(org.w3c.dom.Element inputDocuments, org.w3c.dom.Element signature) throws TSAServiceInvokerExceptionMethod that checks if the input document associated to a renovation of a XML time-stamp is structurally correct.- Parameters:
inputDocuments- Parameter that represents thedss:InputDocumentselement of the time-stamp renovation request.signature- Parameter that represents theds:Signatureelement 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 TSAServiceInvokerExceptionMethod that checks if the input document associated to a renovation of a RFC 3161 time-stamp is structurally correct.- Parameters:
inputDocuments- Parameter that represents thedss:InputDocumentselement of the time-stamp renovation request.tst- Parameter that represents thr RFC 3161 time-stamp.- Throws:
TSAServiceInvokerException- If the input document isn't valid.
-
-