public final class UtilsTimestamp
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@.
| Modifier and Type | Field and Description |
|---|---|
static Logger |
LOGGER
Attribute that represents the object that manages the log of the class.
|
| Modifier and Type | Method and 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.util.Date |
getGenTimeXMLTimestamp(org.w3c.dom.Element xmlTimestamp)
Method that obtains the gentime from a XML timestamp.
|
static java.security.cert.X509Certificate |
getSigningCertificate(org.bouncycastle.tsp.TimeStampToken tst)
Method that obtain the the signing certificate of a timestamp.
|
static org.bouncycastle.tsp.TimeStampToken |
getTimestampFromRFC3161Service(byte[] dataToStamp,
java.lang.String applicationID,
java.lang.String tsaCommunicationMode)
Method that obtains an ASN.1 timestamp from TS@ RFC 3161 service.
|
static org.bouncycastle.tsp.TimeStampToken |
getTimestampFromRFC3161Service(byte[] dataToStamp,
java.lang.String applicationID,
java.lang.String tsaCommunicationMode,
java.lang.String idClient)
Method that obtains an ASN.1 timestamp from TS@ RFC 3161 service.
|
static org.bouncycastle.tsp.TimeStampToken |
getTimeStampToken(org.bouncycastle.cms.SignerInformation signerInformation)
Method that obtains the timestamp from the information about a signer of a signature, if it contains a timestamp.
|
static void |
validateASN1Timestamp(org.bouncycastle.tsp.TimeStampToken tst)
Method that validates an ASN.1 timestamp.
|
static void |
validateXMLTimestamp(org.w3c.dom.Element tst)
Method that validates a XML timestamp.
|
public static final Logger LOGGER
public static org.bouncycastle.tsp.TimeStampToken getTimestampFromRFC3161Service(byte[] dataToStamp,
java.lang.String applicationID,
java.lang.String tsaCommunicationMode,
java.lang.String idClient)
throws SigningException
dataToStamp - Parameter that represents the data to stamp.applicationID - Parameter that represents the identifier of the client application.tsaCommunicationMode - Parameter that represents the protocol defined to communicate with TS@. The allowed values are:
#TSA_RFC3161_TCP_COMMUNICATION for TCP communication.#TSA_RFC3161_HTTPS_COMMUNICATION for HTTPS communication.#TSA_RFC3161_SSL_COMMUNICATION for SSL communication.idClient - Parameter that represents the client application identifier.SigningException - If the method fails.public static org.bouncycastle.tsp.TimeStampToken getTimestampFromRFC3161Service(byte[] dataToStamp,
java.lang.String applicationID,
java.lang.String tsaCommunicationMode)
throws SigningException
dataToStamp - Parameter that represents the data to stamp.applicationID - Parameter that represents the identifier of the client application.tsaCommunicationMode - Parameter that represents the protocol defined to communicate with TS@. The allowed values are:
#TSA_RFC3161_TCP_COMMUNICATION for TCP communication.#TSA_RFC3161_HTTPS_COMMUNICATION for HTTPS communication.#TSA_RFC3161_SSL_COMMUNICATION for SSL communication.SigningException - If the method fails.public static java.security.cert.X509Certificate getSigningCertificate(org.bouncycastle.tsp.TimeStampToken tst)
throws SigningException
tst - Parameter that represents the timestamp.SigningException - If the method fails.public static void validateXMLTimestamp(org.w3c.dom.Element tst)
throws SigningException
tst - Parameter that represents the XML timestamp.SigningException - If the validation fails.public static void validateASN1Timestamp(org.bouncycastle.tsp.TimeStampToken tst)
throws SigningException
tst - Parameter that represents the ASN.1 timestamp to validate.SigningException - If the method fails or the timestamp isn't valid.public static org.bouncycastle.tsp.TimeStampToken getTimeStampToken(org.bouncycastle.cms.SignerInformation signerInformation)
throws SigningException
signerInformation - Parameter that represents the information of the signer.null.SigningException - If the timestamp is malformed.public static void checkInputDocumentXMLTimeStamp(org.w3c.dom.Element inputDocuments,
org.w3c.dom.Element signature)
throws TSAServiceInvokerException
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.TSAServiceInvokerException - If the validation fails.public static void checkInputDocumentRFC3161TimeStamp(org.w3c.dom.Element inputDocuments,
org.bouncycastle.tsp.TimeStampToken tst)
throws TSAServiceInvokerException
inputDocuments - Parameter that represents the dss:InputDocuments element of the time-stamp renovation request.tst - Parameter that represents thr RFC 3161 time-stamp.TSAServiceInvokerException - If the input document isn't valid.public static java.util.Date getGenTimeXMLTimestamp(org.w3c.dom.Element xmlTimestamp)
throws SigningException
xmlTimestamp - Parameter that represents the XML timestamp.SigningException - If the gentime cannot parse to UTC format.