Class XAdESTimestampDataBuilder
java.lang.Object
eu.europa.esig.dss.xades.validation.timestamp.XAdESTimestampDataBuilder
- All Implemented Interfaces:
TimestampDataBuilder
Builds a message-imprint for XAdES timestamps
-
Constructor Summary
ConstructorsConstructorDescriptionXAdESTimestampDataBuilder(Element signature, List<org.apache.xml.security.signature.Reference> references, XAdESPaths xadesPaths) Default constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected DSSDocumentgetAllDataObjectsTimestampData(TimestampToken timestampToken) Returns the computed message-imprint for xades132:AllDataObjectsTimestamp tokengetArchiveTimestampData(TimestampToken timestampToken) Archive timestamp seals the data of the signature in a specific order.protected byte[]getArchiveTimestampData(TimestampToken timestampToken, String canonicalizationMethod) Gathers the data to be used to calculate the hash value sent to the TSA (messageImprint).byte[]getArchiveTimestampData(String canonicalizationMethod) Returns ArchiveTimestamp message-imprint data for a new timestampgetContentTimestampData(TimestampToken timestampToken) Returns the content timestamp data (timestamped or to be).protected DSSDocumentgetIndividualDataObjectsTimestampData(TimestampToken timestampToken) Returns the computed message-imprint for xades132:IndividualDataObjectsTimestamp tokengetSignatureTimestampData(TimestampToken timestampToken) Returns the data (signature value) that was timestamped by the SignatureTimeStamp for the given timestamp.protected byte[]getSignatureTimestampData(TimestampToken timestampToken, String canonicalizationMethod) Returns a message-imprint for a signature timestampbyte[]getSignatureTimestampData(String canonicalizationMethod) Returns SignatureTimestamp Data for a new TimestampgetTimestampX1Data(TimestampToken timestampToken) Returns the data to be time-stamped.protected byte[]getTimestampX1Data(TimestampToken timestampToken, String canonicalizationMethod, Boolean en319132) Computes the message-imprint for SigAndRefsTimestamp/SigAndRefsTimestampV2byte[]getTimestampX1Data(String canonicalizationMethod, boolean en319132) Returns SigAndRefsTimestamp/SigAndRefsTimestampV2 message-imprint data for a new timestampgetTimestampX2Data(TimestampToken timestampToken) Returns the data to be time-stamped which contains the concatenation of CompleteCertificateRefs and CompleteRevocationRefs elements (XAdES example).protected byte[]getTimestampX2Data(TimestampToken timestampToken, String canonicalizationMethod, Boolean en319132) Computes the message-imprint for RefsOnlyTimestamp/RefsOnlyTimestampV2byte[]getTimestampX2Data(String canonicalizationMethod, boolean en319132) Returns RefsOnlyTimestamp/RefsOnlyTimestampV2 message-imprint data for a new timestamp
-
Constructor Details
-
XAdESTimestampDataBuilder
public XAdESTimestampDataBuilder(Element signature, List<org.apache.xml.security.signature.Reference> references, XAdESPaths xadesPaths) Default constructor- Parameters:
signature-Elementthe signature elementreferences- a list of foundReferencesxadesPaths-XAdESPaths
-
-
Method Details
-
getContentTimestampData
Description copied from interface:TimestampDataBuilderReturns the content timestamp data (timestamped or to be).- Specified by:
getContentTimestampDatain interfaceTimestampDataBuilder- Parameters:
timestampToken-TimestampToken- Returns:
DSSDocumentrepresenting the canonicalized data to be timestamped
-
getAllDataObjectsTimestampData
Returns the computed message-imprint for xades132:AllDataObjectsTimestamp token- Parameters:
timestampToken-TimestampToken- Returns:
DSSDocumentmessage-imprint
-
getIndividualDataObjectsTimestampData
Returns the computed message-imprint for xades132:IndividualDataObjectsTimestamp token- Parameters:
timestampToken-TimestampToken- Returns:
DSSDocumentmessage-imprint
-
getSignatureTimestampData
Description copied from interface:TimestampDataBuilderReturns the data (signature value) that was timestamped by the SignatureTimeStamp for the given timestamp.- Specified by:
getSignatureTimestampDatain interfaceTimestampDataBuilder- Parameters:
timestampToken-TimestampToken- Returns:
DSSDocumentrepresenting the canonicalized data to be timestamped
-
getSignatureTimestampData
Returns SignatureTimestamp Data for a new Timestamp- Parameters:
canonicalizationMethod-Stringcanonicalization method to use- Returns:
- timestamp data
-
getSignatureTimestampData
protected byte[] getSignatureTimestampData(TimestampToken timestampToken, String canonicalizationMethod) Returns a message-imprint for a signature timestamp- Parameters:
timestampToken-TimestampTokencanonicalizationMethod-String- Returns:
- message-imprint
-
getTimestampX1Data
Description copied from interface:TimestampDataBuilderReturns the data to be time-stamped. The data contains the digital signature (XAdES example: ds:SignatureValue element), the signature time-stamp(s) present in the AdES-T form, the certification path references and the revocation status references.- Specified by:
getTimestampX1Datain interfaceTimestampDataBuilder- Parameters:
timestampToken-TimestampTokenor null during the creation process- Returns:
DSSDocumentrepresenting the canonicalized data to be timestamped
-
getTimestampX1Data
Returns SigAndRefsTimestamp/SigAndRefsTimestampV2 message-imprint data for a new timestamp- Parameters:
canonicalizationMethod-Stringcanonicalization method to useen319132- defines if the timestamp shall be created accordingly to ETSI EN 319 132-1 (SigAndRefsTimestampV2)- Returns:
- message-imprint octets
-
getTimestampX1Data
protected byte[] getTimestampX1Data(TimestampToken timestampToken, String canonicalizationMethod, Boolean en319132) Computes the message-imprint for SigAndRefsTimestamp/SigAndRefsTimestampV2- Parameters:
timestampToken-TimestampTokenon signature validationcanonicalizationMethod-Stringcanonicalization method to useen319132- defines if the timestamp shall be created accordingly to ETSI EN 319 132-1 (SigAndRefsTimestampV2)- Returns:
- message-imprint octets
-
getTimestampX2Data
Description copied from interface:TimestampDataBuilderReturns the data to be time-stamped which contains the concatenation of CompleteCertificateRefs and CompleteRevocationRefs elements (XAdES example).- Specified by:
getTimestampX2Datain interfaceTimestampDataBuilder- Parameters:
timestampToken-TimestampToken- Returns:
DSSDocumentrepresenting the canonicalized data to be timestamped
-
getTimestampX2Data
Returns RefsOnlyTimestamp/RefsOnlyTimestampV2 message-imprint data for a new timestamp- Parameters:
canonicalizationMethod-Stringcanonicalization method to useen319132- defines if the timestamp shall be created accordingly to ETSI EN 319 132-1 (RefsOnlyTimestampV2)- Returns:
- message-imprint octets
-
getTimestampX2Data
protected byte[] getTimestampX2Data(TimestampToken timestampToken, String canonicalizationMethod, Boolean en319132) Computes the message-imprint for RefsOnlyTimestamp/RefsOnlyTimestampV2- Parameters:
timestampToken-TimestampTokenon signature validationcanonicalizationMethod-Stringcanonicalization method to useen319132- defines if the timestamp shall be created accordingly to ETSI EN 319 132-1 (RefsOnlyTimestampV2)- Returns:
- message-imprint octets
-
getArchiveTimestampData
Description copied from interface:TimestampDataBuilderArchive timestamp seals the data of the signature in a specific order. We need to retrieve the data for each timestamp.- Specified by:
getArchiveTimestampDatain interfaceTimestampDataBuilder- Parameters:
timestampToken-TimestampTokennull when adding a new archive timestamp- Returns:
DSSDocumentrepresenting the canonicalized data to be timestamped
-
getArchiveTimestampData
Returns ArchiveTimestamp message-imprint data for a new timestamp- Parameters:
canonicalizationMethod-Stringcanonicalization method to use- Returns:
- message-imprint octets
-
getArchiveTimestampData
protected byte[] getArchiveTimestampData(TimestampToken timestampToken, String canonicalizationMethod) Gathers the data to be used to calculate the hash value sent to the TSA (messageImprint).- Parameters:
timestampToken-TimestampTokento validate, ornullwhen adding a new archive timestampcanonicalizationMethod-String- Returns:
bytearray containing the canonicalized and concatenated timestamped data
-