Class SignatureTimestampSource<AS extends AdvancedSignature,SA extends SignatureAttribute>
java.lang.Object
eu.europa.esig.dss.spi.validation.timestamp.AbstractTimestampSource
eu.europa.esig.dss.spi.validation.timestamp.SignatureTimestampSource<AS,SA>
- Type Parameters:
AS-AdvancedSignatureimplementationSA- the correspondingSignatureAttribute
- All Implemented Interfaces:
TimestampSource,Serializable
- Direct Known Subclasses:
CAdESTimestampSource,JAdESTimestampSource,XAdESTimestampSource
public abstract class SignatureTimestampSource<AS extends AdvancedSignature,SA extends SignatureAttribute>
extends AbstractTimestampSource
implements TimestampSource
The timestamp source of a signature
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<TimestampToken> This variable contains the list of enclosed archive signature timestamps.protected ListCertificateSourceCertificateSource containing merged data from signature and timestampsprotected List<TimestampToken> Enclosed content timestamps.protected ListRevocationSource<CRL> CRL revocation source containing merged data from signature and timestampsprotected List<EvidenceRecord> This variable contains the list of evidence records detached from the signature document.protected List<TimestampToken> This variable contains the list of detached timestamp tokens (used in ASiC with CAdES).protected List<EvidenceRecord> This variable contains the list of evidence records embedded to the signature document.protected ListRevocationSource<OCSP> OCSP revocation source containing merged data from signature and timestampsprotected List<TimestampToken> Enclosed RefsOnly timestamps.protected List<TimestampToken> Enclosed SignAndRefs timestamps.protected final ASThe signature is being validatedprotected List<TimestampToken> Enclosed signature timestamps.protected List<TimestampedReference> A list of all TimestampedReferences extracted from a signature -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSignatureTimestampSource(AS signature) Default constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExternalEvidenceRecord(EvidenceRecord evidenceRecord) This method allows to add an external evidence record.voidaddExternalTimestamp(TimestampToken timestamp) This method allows to add an external timestamp.protected abstract SignatureProperties<SA> Creates the 'signed-signature-properties' element of the signatureprotected abstract SignatureProperties<SA> Creates the 'unsigned-signature-properties' element of the signatureprotected voidCreates and validates all timestamps Must be called only onceReturns a list of all evidence records associated with the signatureReturns a list of all incorporated timestampsReturns a list of allTimestampTokens except the last archive timestampprotected List<TimestampedReference> getArchiveTimestampReferences(List<TimestampToken> previousTimestamps) Returns a list of time-stamped references for an archival time-stampReturns a list of incorporated archive timestampsprotected abstract ArchiveTimestampTypegetArchiveTimestampType(SA unsignedAttribute) ReturnsArchiveTimestampTypefor the givenunsignedAttributeprotected IntegergetAttributeOrder(SA signatureAttribute) Gets position of thesignatureAttributeeither within signed or unsigned propertiesprotected abstract List<CertificateRef> getCertificateRefs(SA unsignedAttribute) Returns a list ofCertificateRefs from the givenunsignedAttributeReturns a list of incorporated content timestampsprotected List<TimestampedReference> getCounterSignatureReferences(AdvancedSignature counterSignature) Returns a list of references extracted from a counter signatureprotected abstract List<AdvancedSignature> getCounterSignatures(SA unsignedAttribute) Extracts Counter Signatures from the givenunsignedAttributeprotected List<TimestampedReference> getCounterSignaturesReferences(List<AdvancedSignature> counterSignatures) Returns a list ofTimestampedReferences encapsulated from the list of counter signaturesgetCRLRefs(SA unsignedAttribute) Returns a list of CRL revocation refs from the givenunsignedAttributeReturns a list of evidence records detached from a signature documentReturns a list of detached timestamps (used in ASiC with CAdES)Returns a list of incorporated document timestamps (PAdES only)Returns a list of evidence records embedded to a signature documentprotected abstract List<Identifier> getEncapsulatedCertificateIdentifiers(SA unsignedAttribute) Returns a list ofIdentifiers obtained from the givenunsignedAttributegetEncapsulatedCRLIdentifiers(SA unsignedAttribute) Returns a list ofCRLBinarys obtained from the givenunsignedAttributeprotected abstract List<OCSPResponseBinary> getEncapsulatedOCSPIdentifiers(SA unsignedAttribute) Returns a list ofOCSPResponseBinarys obtained from the givenunsignedAttributeprotected List<TimestampedReference> getEncapsulatedReferencesFromTimestamps(List<TimestampToken> timestampTokens) Returns a list of TimestampedReferences for tokens encapsulated within the list of timestampTokensprotected List<TimestampedReference> Returns references from the KeyInfo (for XAdES) encapsulated elementsgetOCSPRefs(SA unsignedAttribute) Returns a list of OCSP revocation refs from the givenunsignedAttributeprotected TimestampedReferenceCreates a timestamped reference for the current signatureprotected List<TimestampedReference> Returns a list of allTimestampedReferences found into CMS SignedData of the signature NOTE: used only in ASiC-E CAdESprotected List<TimestampedReference> Returns a list ofTimestampedReferencefor a "signature-timestamp" elementReturns a list of incorporated signature timestampsprotected SignatureProperties<SA> Returns the 'signed-signature-properties' element of the signatureReturns a list ofTimestampedReferences obtained from thesignatureScopesprotected List<TimestampedReference> Returns a list ofTimestampedReferences created from signing certificates of the signatureReturns a mergedListCertificateSourceof all embedded timestamp certificate sourcesReturns a mergedListCertificateSourceof all embedded timestamp certificate sources except the latest Archive TimestampReturns a mergedListRevocationSourceof all embedded timestamp CRL sourcesprotected List<TimestampedReference> getTimestampedCertificateRefs(SA unsignedAttribute) Returns a list ofTimestampedReferencecertificate refs found in the givenunsignedAttributeprotected List<TimestampedReference> getTimestampedCertificateValues(SA unsignedAttribute) Returns a list ofTimestampedReferences from theunsignedAttributecontaining certificate valuesprotected List<TimestampedReference> getTimestampedRevocationRefs(SA unsignedAttribute) Returns a list ofTimestampedReferencerevocation refs found in the givenunsignedAttributeprotected List<TimestampedReference> getTimestampedRevocationValues(SA unsignedAttribute) Returns a list of timestamped revocation references extracted from the given unsigned attributeprotected abstract TimestampMessageDigestBuildergetTimestampMessageImprintDigestBuilder(DigestAlgorithm digestAlgorithm) Returns aTimestampMessageDigestBuilderto compute message digest with the providedDigestAlgorithmprotected abstract TimestampMessageDigestBuildergetTimestampMessageImprintDigestBuilder(TimestampToken timestampToken) Returns a relatedTimestampMessageDigestBuilderReturns a mergedListRevocationSourceof all embedded timestamp OCSP sourcesprotected List<SignatureScope> getTimestampScopes(TimestampToken timestampToken) Generates timestamp token scopesReturns a list of incorporated SigAndRefs timestampsReturns a list of incorporated RefsOnly timestampsprotected List<TimestampedReference> getTimestampValidationData(SA unsignedAttribute) Returns a list ofTimestampedReferences encapsulated to the "timestamp-validation-data"unsignedAttributeReturns a list ofTimestampedReferences for all tokens embedded into unsigned properties of the signatureprotected SignatureProperties<SA> Returns the 'unsigned-signature-properties' element of the signatureprotected voidincorporateArchiveTimestampReferences(TimestampToken timestampToken, List<TimestampToken> previousTimestamps) The method incorporates all the timestamped references for the given archivetimestampTokenprotected abstract booleanisAllDataObjectsTimestamp(SA signedAttribute) Determines if the givensignedAttributeis an instance of "data-objects-timestamp" element NOTE: Applicable only for XAdESprotected abstract booleanisArchiveTimestamp(SA unsignedAttribute) Determines if the givenunsignedAttributeis an instance of "archive-timestamp" elementprotected abstract booleanisAttrAuthoritiesCertValues(SA unsignedAttribute) Determines if the givenunsignedAttributeis an instance of "AttrAuthoritiesCertValues" elementprotected abstract booleanisAttributeCertificateRef(SA unsignedAttribute) Determines if the givenunsignedAttributeis an instance of "attribute-certificate-ref" elementprotected abstract booleanisAttributeRevocationRef(SA unsignedAttribute) Determines if the givenunsignedAttributeis an instance of "attribute-revocation-ref" elementprotected abstract booleanisAttributeRevocationValues(SA unsignedAttribute) Determines if the givenunsignedAttributeis an instance of "AttributeRevocationValues" elementprotected abstract booleanisCertificateValues(SA unsignedAttribute) Determines if the givenunsignedAttributeis an instance of "certificate-values" elementprotected abstract booleanisCompleteCertificateRef(SA unsignedAttribute) Determines if the givenunsignedAttributeis an instance of "complete-certificate-ref" elementprotected abstract booleanisCompleteRevocationRef(SA unsignedAttribute) Determines if the givenunsignedAttributeis an instance of "complete-revocation-ref" elementprotected abstract booleanisContentTimestamp(SA signedAttribute) Determines if the givensignedAttributeis an instance of "content-timestamp" element NOTE: Applicable only for CAdESprotected abstract booleanisCounterSignature(SA unsignedAttribute) Determines if the givenunsignedAttributeis an instance of "counter-signature" elementprotected abstract booleanisEvidenceRecord(SA unsignedAttribute) Determines if the givenunsignedAttributeis an instance of "evidence-record" elementprotected abstract booleanisIndividualDataObjectsTimestamp(SA signedAttribute) Determines if the givensignedAttributeis an instance of "individual-data-objects-timestamp" element NOTE: Applicable only for XAdESprotected abstract booleanisRefsOnlyTimestamp(SA unsignedAttribute) Determines if the givenunsignedAttributeis an instance of "refs-only-timestamp" elementprotected abstract booleanisRevocationValues(SA unsignedAttribute) Determines if the givenunsignedAttributeis an instance of "revocation-values" elementprotected abstract booleanisSigAndRefsTimestamp(SA unsignedAttribute) Determines if the givenunsignedAttributeis an instance of "sig-and-refs-timestamp" elementprotected abstract booleanisSignaturePolicyStore(SA unsignedAttribute) Determines if the givenunsignedAttributeis an instance of "signature-policy-store" elementprotected abstract booleanisSignatureTimestamp(SA unsignedAttribute) Determines if the givenunsignedAttributeis an instance of "signature-timestamp" elementbooleanisTimestamped(String tokenId, TimestampedObjectType objectType) Checks if a tokenId with the given Id is covered by the timestamp sourceprotected abstract booleanisTimeStampValidationData(SA unsignedAttribute) Determines if the givenunsignedAttributeis an instance of "timestamp-validation-data" elementprotected abstract List<EvidenceRecord> makeEvidenceRecords(SA signatureAttribute, List<TimestampedReference> references) Creates a list of evidence records from the providedsignatureAttributeprotected abstract TimestampTokenmakeTimestampToken(SA signatureAttribute, TimestampType timestampType, List<TimestampedReference> references) Creates a timestamp token from the providedsignatureAttributeprotected voidPopulates all the lists by data found into the signatureprotected List<TimestampToken> makeTimestampTokens(SA signatureAttribute, TimestampType timestampType) Creates timestamp tokens from the providedsignatureAttributeprotected List<TimestampToken> makeTimestampTokens(SA signatureAttribute, TimestampType timestampType, List<TimestampedReference> references) Creates timestamp tokens from the providedsignatureAttributewith a given list ofTimestampedReferencesprotected voidCreates TimestampTokens from all instances extracted from signed attributes (content TSTs)protected voidCreates TimestampTokens from found instances in unsigned propertiesprotected voidpopulateSources(EvidenceRecord externalEvidenceRecord) Allows to populate all sources from an external evidence recordprotected voidpopulateSources(TimestampToken timestampToken) Allows to populate all merged sources with extracted from a timestamp dataprotected voidpopulateSources(List<TimestampToken> timestampTokens) Allows to populate all merged sources with extracted from a timestamp dataprotected voidValidates list of all timestamps present in the sourceMethods inherited from class eu.europa.esig.dss.spi.validation.timestamp.AbstractTimestampSource
addReference, addReference, addReferences, createReferenceForCertificate, createReferenceForIdentifier, createReferencesForCertificateRefs, createReferencesForCertificates, createReferencesForCRLBinaries, createReferencesForCRLRefs, createReferencesForIdentifiers, createReferencesForOCSPBinaries, createReferencesForOCSPBinary, createReferencesForOCSPRefs, getEncapsulatedValuesFromTimestamp, getReferencesFromTimestamp, getSignerDataTimestampedReferences, processEmbeddedEvidenceRecords, processEvidenceRecordTimestamps
-
Field Details
-
signature
The signature is being validated -
crlSource
CRL revocation source containing merged data from signature and timestamps -
ocspSource
OCSP revocation source containing merged data from signature and timestamps -
certificateSource
CertificateSource containing merged data from signature and timestamps -
contentTimestamps
Enclosed content timestamps. -
signatureTimestamps
Enclosed signature timestamps. -
sigAndRefsTimestamps
Enclosed SignAndRefs timestamps. -
refsOnlyTimestamps
Enclosed RefsOnly timestamps. -
archiveTimestamps
This variable contains the list of enclosed archive signature timestamps. -
detachedTimestamps
This variable contains the list of detached timestamp tokens (used in ASiC with CAdES). -
embeddedEvidenceRecords
This variable contains the list of evidence records embedded to the signature document. -
detachedEvidenceRecords
This variable contains the list of evidence records detached from the signature document. -
unsignedPropertiesReferences
A list of all TimestampedReferences extracted from a signature
-
-
Constructor Details
-
SignatureTimestampSource
Default constructor- Parameters:
signature-AdvancedSignatureis being validated
-
-
Method Details
-
getContentTimestamps
Description copied from interface:TimestampSourceReturns a list of incorporated content timestamps- Specified by:
getContentTimestampsin interfaceTimestampSource- Returns:
- a list of
TimestampTokens
-
getSignatureTimestamps
Description copied from interface:TimestampSourceReturns a list of incorporated signature timestamps- Specified by:
getSignatureTimestampsin interfaceTimestampSource- Returns:
- a list of
TimestampTokens
-
getTimestampsX1
Description copied from interface:TimestampSourceReturns a list of incorporated SigAndRefs timestamps- Specified by:
getTimestampsX1in interfaceTimestampSource- Returns:
- a list of
TimestampTokens
-
getTimestampsX2
Description copied from interface:TimestampSourceReturns a list of incorporated RefsOnly timestamps- Specified by:
getTimestampsX2in interfaceTimestampSource- Returns:
- a list of
TimestampTokens
-
getArchiveTimestamps
Description copied from interface:TimestampSourceReturns a list of incorporated archive timestamps- Specified by:
getArchiveTimestampsin interfaceTimestampSource- Returns:
- a list of
TimestampTokens
-
getDocumentTimestamps
Description copied from interface:TimestampSourceReturns a list of incorporated document timestamps (PAdES only)- Specified by:
getDocumentTimestampsin interfaceTimestampSource- Returns:
- a list of
TimestampTokens
-
getDetachedTimestamps
Description copied from interface:TimestampSourceReturns a list of detached timestamps (used in ASiC with CAdES)- Specified by:
getDetachedTimestampsin interfaceTimestampSource- Returns:
- a list of
TimestampTokens
-
getAllTimestamps
Description copied from interface:TimestampSourceReturns a list of all incorporated timestamps- Specified by:
getAllTimestampsin interfaceTimestampSource- Returns:
- a list of
TimestampTokens
-
getEmbeddedEvidenceRecords
Description copied from interface:TimestampSourceReturns a list of evidence records embedded to a signature document- Specified by:
getEmbeddedEvidenceRecordsin interfaceTimestampSource- Returns:
- a list of
EvidenceRecords
-
getDetachedEvidenceRecords
Description copied from interface:TimestampSourceReturns a list of evidence records detached from a signature document- Specified by:
getDetachedEvidenceRecordsin interfaceTimestampSource- Returns:
- a list of
EvidenceRecords
-
getAllEvidenceRecords
Description copied from interface:TimestampSourceReturns a list of all evidence records associated with the signature- Specified by:
getAllEvidenceRecordsin interfaceTimestampSource- Returns:
- a list of
EvidenceRecords
-
getTimestampCertificateSources
Description copied from interface:TimestampSourceReturns a mergedListCertificateSourceof all embedded timestamp certificate sources- Specified by:
getTimestampCertificateSourcesin interfaceTimestampSource- Returns:
ListCertificateSource
-
getTimestampCertificateSourcesExceptLastArchiveTimestamp
Description copied from interface:TimestampSourceReturns a mergedListCertificateSourceof all embedded timestamp certificate sources except the latest Archive Timestamp- Specified by:
getTimestampCertificateSourcesExceptLastArchiveTimestampin interfaceTimestampSource- Returns:
ListCertificateSource
-
getAllTimestampsExceptLastArchiveTimestamp
Description copied from interface:TimestampSourceReturns a list of allTimestampTokens except the last archive timestamp- Specified by:
getAllTimestampsExceptLastArchiveTimestampin interfaceTimestampSource- Returns:
- a list of
TimestampTokens
-
getTimestampCRLSources
Description copied from interface:TimestampSourceReturns a mergedListRevocationSourceof all embedded timestamp CRL sources- Specified by:
getTimestampCRLSourcesin interfaceTimestampSource- Returns:
ListRevocationSource
-
getTimestampOCSPSources
Description copied from interface:TimestampSourceReturns a mergedListRevocationSourceof all embedded timestamp OCSP sources- Specified by:
getTimestampOCSPSourcesin interfaceTimestampSource- Returns:
ListRevocationSource
-
getUnsignedPropertiesReferences
Description copied from interface:TimestampSourceReturns a list ofTimestampedReferences for all tokens embedded into unsigned properties of the signature- Specified by:
getUnsignedPropertiesReferencesin interfaceTimestampSource- Returns:
- a list of
TimestampedReferences
-
createAndValidate
protected void createAndValidate()Creates and validates all timestamps Must be called only once -
addExternalTimestamp
Description copied from interface:TimestampSourceThis method allows to add an external timestamp. The given timestamp must be processed before.- Specified by:
addExternalTimestampin interfaceTimestampSource- Parameters:
timestamp-TimestampTokenthe timestamp token
-
addExternalEvidenceRecord
Description copied from interface:TimestampSourceThis method allows to add an external evidence record. The given evidence record must be processed before.- Specified by:
addExternalEvidenceRecordin interfaceTimestampSource- Parameters:
evidenceRecord-EvidenceRecordthe evidence record covering the signature file
-
makeTimestampTokens
protected void makeTimestampTokens()Populates all the lists by data found into the signature -
makeTimestampTokensFromSignedAttributes
protected void makeTimestampTokensFromSignedAttributes()Creates TimestampTokens from all instances extracted from signed attributes (content TSTs) -
makeTimestampTokensFromUnsignedAttributes
protected void makeTimestampTokensFromUnsignedAttributes()Creates TimestampTokens from found instances in unsigned properties -
getSignedSignatureProperties
Returns the 'signed-signature-properties' element of the signature- Returns:
SignatureProperties
-
buildSignedSignatureProperties
Creates the 'signed-signature-properties' element of the signature- Returns:
SignatureProperties
-
getUnsignedSignatureProperties
Returns the 'unsigned-signature-properties' element of the signature- Returns:
SignatureProperties
-
buildUnsignedSignatureProperties
Creates the 'unsigned-signature-properties' element of the signature- Returns:
SignatureProperties
-
isContentTimestamp
Determines if the givensignedAttributeis an instance of "content-timestamp" element NOTE: Applicable only for CAdES- Parameters:
signedAttribute-SignatureAttributeto process- Returns:
- TRUE if the
unsignedAttributeis a Data Objects Timestamp, FALSE otherwise
-
isAllDataObjectsTimestamp
Determines if the givensignedAttributeis an instance of "data-objects-timestamp" element NOTE: Applicable only for XAdES- Parameters:
signedAttribute-SignatureAttributeto process- Returns:
- TRUE if the
unsignedAttributeis a Data Objects Timestamp, FALSE otherwise
-
isIndividualDataObjectsTimestamp
Determines if the givensignedAttributeis an instance of "individual-data-objects-timestamp" element NOTE: Applicable only for XAdES- Parameters:
signedAttribute-SignatureAttributeto process- Returns:
- TRUE if the
unsignedAttributeis a Data Objects Timestamp, FALSE otherwise
-
isSignatureTimestamp
Determines if the givenunsignedAttributeis an instance of "signature-timestamp" element- Parameters:
unsignedAttribute-SignatureAttributeto process- Returns:
- TRUE if the
unsignedAttributeis a Signature Timestamp, FALSE otherwise
-
isCompleteCertificateRef
Determines if the givenunsignedAttributeis an instance of "complete-certificate-ref" element- Parameters:
unsignedAttribute-SignatureAttributeto process- Returns:
- TRUE if the
unsignedAttributeis a Complete Certificate Ref, FALSE otherwise
-
isAttributeCertificateRef
Determines if the givenunsignedAttributeis an instance of "attribute-certificate-ref" element- Parameters:
unsignedAttribute-SignatureAttributeto process- Returns:
- TRUE if the
unsignedAttributeis an Attribute Certificate Ref, FALSE otherwise
-
isCompleteRevocationRef
Determines if the givenunsignedAttributeis an instance of "complete-revocation-ref" element- Parameters:
unsignedAttribute-SignatureAttributeto process- Returns:
- TRUE if the
unsignedAttributeis a Complete Revocation Ref, FALSE otherwise
-
isAttributeRevocationRef
Determines if the givenunsignedAttributeis an instance of "attribute-revocation-ref" element- Parameters:
unsignedAttribute-SignatureAttributeto process- Returns:
- TRUE if the
unsignedAttributeis an Attribute Revocation Ref, FALSE otherwise
-
isRefsOnlyTimestamp
Determines if the givenunsignedAttributeis an instance of "refs-only-timestamp" element- Parameters:
unsignedAttribute-SignatureAttributeto process- Returns:
- TRUE if the
unsignedAttributeis a Refs Only TimeStamp, FALSE otherwise
-
isSigAndRefsTimestamp
Determines if the givenunsignedAttributeis an instance of "sig-and-refs-timestamp" element- Parameters:
unsignedAttribute-SignatureAttributeto process- Returns:
- TRUE if the
unsignedAttributeis a Sig And Refs TimeStamp, FALSE otherwise
-
isCertificateValues
Determines if the givenunsignedAttributeis an instance of "certificate-values" element- Parameters:
unsignedAttribute-SignatureAttributeto process- Returns:
- TRUE if the
unsignedAttributeis a Certificate Values, FALSE otherwise
-
isRevocationValues
Determines if the givenunsignedAttributeis an instance of "revocation-values" element- Parameters:
unsignedAttribute-SignatureAttributeto process- Returns:
- TRUE if the
unsignedAttributeis a Revocation Values, FALSE otherwise
-
isAttrAuthoritiesCertValues
Determines if the givenunsignedAttributeis an instance of "AttrAuthoritiesCertValues" element- Parameters:
unsignedAttribute-SignatureAttributeto process- Returns:
- TRUE if the
unsignedAttributeis an AttrAuthoritiesCertValues, FALSE otherwise
-
isAttributeRevocationValues
Determines if the givenunsignedAttributeis an instance of "AttributeRevocationValues" element- Parameters:
unsignedAttribute-SignatureAttributeto process- Returns:
- TRUE if the
unsignedAttributeis an AttributeRevocationValues, FALSE otherwise
-
isArchiveTimestamp
Determines if the givenunsignedAttributeis an instance of "archive-timestamp" element- Parameters:
unsignedAttribute-SignatureAttributeto process- Returns:
- TRUE if the
unsignedAttributeis an Archive TimeStamp, FALSE otherwise
-
isTimeStampValidationData
Determines if the givenunsignedAttributeis an instance of "timestamp-validation-data" element- Parameters:
unsignedAttribute-SignatureTimestampSourceto process- Returns:
- TRUE if the
unsignedAttributeis a TimeStamp Validation Data, FALSE otherwise
-
isCounterSignature
Determines if the givenunsignedAttributeis an instance of "counter-signature" element- Parameters:
unsignedAttribute-SignatureTimestampSourceto process- Returns:
- TRUE if the
unsignedAttributeis a Counter signature, FALSE otherwise
-
isSignaturePolicyStore
Determines if the givenunsignedAttributeis an instance of "signature-policy-store" element- Parameters:
unsignedAttribute-SignatureTimestampSourceto process- Returns:
- TRUE if the
unsignedAttributeis a Counter signature, FALSE otherwise
-
isEvidenceRecord
Determines if the givenunsignedAttributeis an instance of "evidence-record" element- Parameters:
unsignedAttribute-SignatureTimestampSourceto process- Returns:
- TRUE if the
unsignedAttributeis an evidence record, FALSE otherwise
-
makeTimestampToken
protected abstract TimestampToken makeTimestampToken(SA signatureAttribute, TimestampType timestampType, List<TimestampedReference> references) Creates a timestamp token from the providedsignatureAttribute- Parameters:
signatureAttribute-SignatureAttributeto create timestamp fromtimestampType- a targetTimestampTypereferences- list ofTimestampedReferences covered by the current timestamp- Returns:
TimestampToken
-
makeTimestampTokens
protected List<TimestampToken> makeTimestampTokens(SA signatureAttribute, TimestampType timestampType) Creates timestamp tokens from the providedsignatureAttribute- Parameters:
signatureAttribute-SignatureAttributeto create timestamp fromtimestampType- a targetTimestampType- Returns:
- a list of
TimestampTokens
-
makeTimestampTokens
protected List<TimestampToken> makeTimestampTokens(SA signatureAttribute, TimestampType timestampType, List<TimestampedReference> references) Creates timestamp tokens from the providedsignatureAttributewith a given list ofTimestampedReferences- Parameters:
signatureAttribute-SignatureAttributeto create timestamp fromtimestampType- a targetTimestampTypereferences- list ofTimestampedReferences covered by the current timestamp- Returns:
- a list of
TimestampTokens
-
makeEvidenceRecords
protected abstract List<EvidenceRecord> makeEvidenceRecords(SA signatureAttribute, List<TimestampedReference> references) Creates a list of evidence records from the providedsignatureAttribute- Parameters:
signatureAttribute-SignatureAttributeto create evidence records fromreferences- list ofTimestampedReferences covered by the current evidence record(s)- Returns:
- a list of
EvidenceRecords
-
getSignerDataReferences
Description copied from interface:TimestampSourceReturns a list ofTimestampedReferences obtained from thesignatureScopes- Specified by:
getSignerDataReferencesin interfaceTimestampSource- Returns:
- list of
TimestampedReferences
-
getSignatureTimestampReferences
Returns a list ofTimestampedReferencefor a "signature-timestamp" element- Returns:
- list of
TimestampedReferences
-
getSignatureReference
Creates a timestamped reference for the current signature- Returns:
TimestampedReference
-
getEncapsulatedReferencesFromTimestamps
protected List<TimestampedReference> getEncapsulatedReferencesFromTimestamps(List<TimestampToken> timestampTokens) Returns a list of TimestampedReferences for tokens encapsulated within the list of timestampTokens- Parameters:
timestampTokens- a list ofTimestampTokento get references from- Returns:
- a list of
TimestampedReferences
-
getSigningCertificateTimestampReferences
Returns a list ofTimestampedReferences created from signing certificates of the signature- Returns:
- list of
TimestampedReferences
-
getKeyInfoReferences
Returns references from the KeyInfo (for XAdES) encapsulated elements- Returns:
- list of
TimestampedReferences
-
getTimestampedCertificateRefs
Returns a list ofTimestampedReferencecertificate refs found in the givenunsignedAttribute- Parameters:
unsignedAttribute-SignatureTimestampSourceto find references from- Returns:
- list of
TimestampedReferences
-
getCertificateRefs
Returns a list ofCertificateRefs from the givenunsignedAttribute- Parameters:
unsignedAttribute-SignatureTimestampSourceto get certRefs from- Returns:
- list of
CertificateRefs
-
getTimestampedRevocationRefs
Returns a list ofTimestampedReferencerevocation refs found in the givenunsignedAttribute- Parameters:
unsignedAttribute-SignatureTimestampSourceto find references from- Returns:
- list of
TimestampedReferences
-
getCRLRefs
Returns a list of CRL revocation refs from the givenunsignedAttribute- Parameters:
unsignedAttribute-SignatureTimestampSourceto get CRLRef- Returns:
- list of
CRLRefs
-
getOCSPRefs
Returns a list of OCSP revocation refs from the givenunsignedAttribute- Parameters:
unsignedAttribute-SignatureTimestampSourceto get OCSPRefs from- Returns:
- list of
OCSPRefs
-
getTimestampedCertificateValues
Returns a list ofTimestampedReferences from theunsignedAttributecontaining certificate values- Parameters:
unsignedAttribute-SignatureTimestampSourceto extract certificate values from- Returns:
- a list of
TimestampedReferences
-
getEncapsulatedCertificateIdentifiers
Returns a list ofIdentifiers obtained from the givenunsignedAttribute- Parameters:
unsignedAttribute-SignatureTimestampSourceto get certificate identifiers from- Returns:
- list of
Identifiers
-
getTimestampedRevocationValues
Returns a list of timestamped revocation references extracted from the given unsigned attribute- Parameters:
unsignedAttribute-SignatureTimestampSourcecontaining revocation data- Returns:
- a list of
TimestampedReferences
-
getEncapsulatedCRLIdentifiers
-
getEncapsulatedOCSPIdentifiers
Returns a list ofOCSPResponseBinarys obtained from the givenunsignedAttribute- Parameters:
unsignedAttribute-SignatureTimestampSourceto get OCSP identifiers from- Returns:
- list of
OCSPResponseBinarys
-
incorporateArchiveTimestampReferences
protected void incorporateArchiveTimestampReferences(TimestampToken timestampToken, List<TimestampToken> previousTimestamps) The method incorporates all the timestamped references for the given archivetimestampToken- Parameters:
timestampToken-TimestampTokenrepresenting an Archive TST to add references intopreviousTimestamps- a list of previously createdTimestampTokens
-
getArchiveTimestampReferences
protected List<TimestampedReference> getArchiveTimestampReferences(List<TimestampToken> previousTimestamps) Returns a list of time-stamped references for an archival time-stamp- Parameters:
previousTimestamps- a list of previousTimestampTokens- Returns:
- a list of
TimestampedReferences
-
getSignatureSignedDataReferences
Returns a list of allTimestampedReferences found into CMS SignedData of the signature NOTE: used only in ASiC-E CAdES- Returns:
- list of
TimestampedReferences
-
getTimestampValidationData
Returns a list ofTimestampedReferences encapsulated to the "timestamp-validation-data"unsignedAttribute- Parameters:
unsignedAttribute-SignatureTimestampSourceto get timestamped references from- Returns:
- list of
TimestampedReferences
-
getCounterSignaturesReferences
protected List<TimestampedReference> getCounterSignaturesReferences(List<AdvancedSignature> counterSignatures) Returns a list ofTimestampedReferences encapsulated from the list of counter signatures- Parameters:
counterSignatures- a list ofAdvancedSignatureto get timestamped references from- Returns:
- list of
TimestampedReferences
-
getCounterSignatureReferences
protected List<TimestampedReference> getCounterSignatureReferences(AdvancedSignature counterSignature) Returns a list of references extracted from a counter signature- Parameters:
counterSignature-AdvancedSignaturerepresenting a counter signature- Returns:
- a list of
TimestampedReferences
-
getCounterSignatures
Extracts Counter Signatures from the givenunsignedAttribute- Parameters:
unsignedAttribute-SignatureTimestampSourcecontaining counter signatures- Returns:
- a list of
AdvancedSignaturecontaining counter signatures
-
getArchiveTimestampType
ReturnsArchiveTimestampTypefor the givenunsignedAttribute- Parameters:
unsignedAttribute-SignatureTimestampSourceto get archive timestamp type for- Returns:
ArchiveTimestampType
-
validateTimestamps
protected void validateTimestamps()Validates list of all timestamps present in the source -
getTimestampMessageImprintDigestBuilder
protected abstract TimestampMessageDigestBuilder getTimestampMessageImprintDigestBuilder(DigestAlgorithm digestAlgorithm) Returns aTimestampMessageDigestBuilderto compute message digest with the providedDigestAlgorithm- Parameters:
digestAlgorithm-DigestAlgorithmto use for message-digest computation- Returns:
TimestampMessageDigestBuilder
-
getTimestampMessageImprintDigestBuilder
protected abstract TimestampMessageDigestBuilder getTimestampMessageImprintDigestBuilder(TimestampToken timestampToken) Returns a relatedTimestampMessageDigestBuilder- Parameters:
timestampToken-TimestampTokento get message-imprint digest builder for- Returns:
TimestampMessageDigestBuilder
-
getTimestampScopes
Generates timestamp token scopes- Parameters:
timestampToken-TimestampTokento get timestamp sources for- Returns:
- a list of
SignatureScopes
-
populateSources
Allows to populate all merged sources with extracted from a timestamp data- Parameters:
timestampTokens- a list ofTimestampTokens to populate data from
-
populateSources
Allows to populate all merged sources with extracted from a timestamp data- Parameters:
timestampToken-TimestampTokento populate data from
-
populateSources
Allows to populate all sources from an external evidence record- Parameters:
externalEvidenceRecord-EvidenceRecordto populate data from
-
isTimestamped
Description copied from interface:TimestampSourceChecks if a tokenId with the given Id is covered by the timestamp source- Specified by:
isTimestampedin interfaceTimestampSource- Parameters:
tokenId-StringId of the token to checkobjectType-TimestampedObjectTypedefining the type of the token- Returns:
- TRUE if the token if covered by the timestamp source, FALSE otherwise
-
getAttributeOrder
Gets position of thesignatureAttributeeither within signed or unsigned properties- Parameters:
signatureAttribute-SignatureAttributeto search for- Returns:
- position of the attribute within properties, NULL if not found
-