Class CAdESTimestampSource
- java.lang.Object
-
- eu.europa.esig.dss.validation.timestamp.AbstractTimestampSource<CAdESAttribute>
-
- eu.europa.esig.dss.cades.validation.CAdESTimestampSource
-
- All Implemented Interfaces:
SignatureTimestampSource,Serializable
- Direct Known Subclasses:
PAdESTimestampSource
public class CAdESTimestampSource extends AbstractTimestampSource<CAdESAttribute>
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected org.bouncycastle.cms.CMSSignedDatacmsSignedDataprotected List<DSSDocument>detachedDocumentsprotected org.bouncycastle.cms.SignerInformationsignerInformation-
Fields inherited from class eu.europa.esig.dss.validation.timestamp.AbstractTimestampSource
certificatePool, crlSource, ocspSource, signatureCertificateSource, signatureCRLSource, signatureId, signatureOCSPSource, signatureScopes, timestampCertificateSource
-
-
Constructor Summary
Constructors Constructor Description CAdESTimestampSource(CAdESSignature signature, CertificatePool certificatePool)
-
Method Summary
Modifier and Type Method Description protected voidaddEncapsulatedValuesFromTimestamp(List<TimestampedReference> references, TimestampToken timestampedTimestamp)Adds to thereferenceslist all validation data embedded to thetimestampedTimestampprotected ArchiveTimestampTypegetArchiveTimestampType(CAdESAttribute unsignedAttribute)ReturnsArchiveTimestampTypefor the givenunsignedAttributeprotected List<Digest>getCertificateRefDigests(CAdESAttribute unsignedAttribute)Returns a list ofDigests from the givenunsignedAttributeprotected List<EncapsulatedCertificateTokenIdentifier>getEncapsulatedCertificateIdentifiers(CAdESAttribute unsignedAttribute)Returns a list ofEncapsulatedCertificateTokenIdentifiers obtained from the givenunsignedAttributeprotected List<CRLBinary>getEncapsulatedCRLIdentifiers(CAdESAttribute unsignedAttribute)Returns a list ofCRLBinarys obtained from the givenunsignedAttributeprotected List<OCSPResponseBinary>getEncapsulatedOCSPIdentifiers(CAdESAttribute unsignedAttribute)Returns a list ofOCSPResponseBinarys obtained from the givenunsignedAttributeprotected List<TimestampedReference>getIndividualContentTimestampedReferences(CAdESAttribute signedAttribute)Returns a list ofTimestampedReferences for an "individual-data-objects-timestamp" NOTE: Used only in XAdESprotected List<Digest>getRevocationRefCRLDigests(CAdESAttribute unsignedAttribute)Returns a list of CRL revocation refDigests from the givenunsignedAttributeprotected List<Digest>getRevocationRefOCSPDigests(CAdESAttribute unsignedAttribute)Returns a list of OCSP revocation refDigests from the givenunsignedAttributeprotected List<TimestampedReference>getSignatureSignedDataReferences()Returns a list of allTimestampedReferences found into CMS SignedData of the signature NOTE: used only in ASiC-E CAdESprotected List<TimestampedReference>getSignedDataReferences(TimestampToken timestampToken)Returns a list ofTimestampedReferences for the giventimestampTokenfound into signed properties of the signature NOTE: used only in CAdES.protected SignatureProperties<CAdESAttribute>getSignedSignatureProperties()Returns the 'signed-signature-properties' element of the signatureprotected CAdESTimestampDataBuildergetTimestampDataBuilder()Returns a relatedTimestampDataBuilderprotected SignatureProperties<CAdESAttribute>getUnsignedSignatureProperties()Returns the 'unsigned-signature-properties' element of the signatureprotected booleanisAllDataObjectsTimestamp(CAdESAttribute signedAttribute)Determines if the givensignedAttributeis an instance of "data-objects-timestamp" element NOTE: Applicable only for XAdESprotected booleanisArchiveTimestamp(CAdESAttribute unsignedAttribute)Determines if the givenunsignedAttributeis an instance of "archive-timestamp" elementprotected booleanisAttributeCertificateRef(CAdESAttribute unsignedAttribute)Determines if the givenunsignedAttributeis an instance of "attribute-certificate-ref" elementprotected booleanisAttributeRevocationRef(CAdESAttribute unsignedAttribute)Determines if the givenunsignedAttributeis an instance of "attribute-revocation-ref" elementprotected booleanisCertificateValues(CAdESAttribute unsignedAttribute)Determines if the givenunsignedAttributeis an instance of "certificate-values" elementprotected booleanisCompleteCertificateRef(CAdESAttribute unsignedAttribute)Determines if the givenunsignedAttributeis an instance of "complete-certificate-ref" elementprotected booleanisCompleteRevocationRef(CAdESAttribute unsignedAttribute)Determines if the givenunsignedAttributeis an instance of "complete-revocation-ref" elementprotected booleanisContentTimestamp(CAdESAttribute signedAttribute)Determines if the givensignedAttributeis an instance of "content-timestamp" element NOTE: Applicable only for CAdESprotected booleanisIndividualDataObjectsTimestamp(CAdESAttribute signedAttribute)Determines if the givensignedAttributeis an instance of "individual-data-objects-timestamp" element NOTE: Applicable only for XAdESprotected booleanisRefsOnlyTimestamp(CAdESAttribute unsignedAttribute)Determines if the givenunsignedAttributeis an instance of "refs-only-timestamp" elementprotected booleanisRevocationValues(CAdESAttribute unsignedAttribute)Determines if the givenunsignedAttributeis an instance of "revocation-values" elementprotected booleanisSigAndRefsTimestamp(CAdESAttribute unsignedAttribute)Determines if the givenunsignedAttributeis an instance of "sig-and-refs-timestamp" elementprotected booleanisSignatureTimestamp(CAdESAttribute unsignedAttribute)Determines if the givenunsignedAttributeis an instance of "signature-timestamp" elementprotected booleanisTimeStampValidationData(CAdESAttribute unsignedAttribute)Determines if the givenunsignedAttributeis an instance of "timestamp-validation-data" elementprotected TimestampTokenmakeTimestampToken(CAdESAttribute signatureAttribute, TimestampType timestampType, List<TimestampedReference> references)Creates a timestamp token from the providedsignatureAttribute-
Methods inherited from class eu.europa.esig.dss.validation.timestamp.AbstractTimestampSource
addExternalTimestamp, addReference, addReferences, addReferencesForPreviousTimestamps, createAndValidate, createReferencesForCertificates, getAllContentTimestampReferences, getAllTimestamps, getArchiveTimestamps, getCertificateMapWithinTimestamps, getCertificates, getCommonCRLSource, getCommonOCSPSource, getContentTimestamps, getDocumentTimestamps, getSignatureTimestampReferences, getSignatureTimestamps, getSigningCertificateTimestampReferences, getTimestampedCertificateRefs, getTimestampedCertificateValues, getTimestampedRevocationRefs, getTimestampedRevocationValues, getTimestampsX1, getTimestampsX2, getTimestampValidationData, makeTimestampTokens, populateTimestampCertificateSource, populateTimestampCertificateSource, validateTimestamps
-
-
-
-
Field Detail
-
signerInformation
protected final transient org.bouncycastle.cms.SignerInformation signerInformation
-
cmsSignedData
protected final transient org.bouncycastle.cms.CMSSignedData cmsSignedData
-
detachedDocuments
protected final transient List<DSSDocument> detachedDocuments
-
-
Constructor Detail
-
CAdESTimestampSource
public CAdESTimestampSource(CAdESSignature signature, CertificatePool certificatePool)
-
-
Method Detail
-
getTimestampDataBuilder
protected CAdESTimestampDataBuilder getTimestampDataBuilder()
Description copied from class:AbstractTimestampSourceReturns a relatedTimestampDataBuilder- Specified by:
getTimestampDataBuilderin classAbstractTimestampSource<CAdESAttribute>- Returns:
TimestampDataBuilder
-
getSignedSignatureProperties
protected SignatureProperties<CAdESAttribute> getSignedSignatureProperties()
Description copied from class:AbstractTimestampSourceReturns the 'signed-signature-properties' element of the signature- Specified by:
getSignedSignaturePropertiesin classAbstractTimestampSource<CAdESAttribute>- Returns:
SignatureProperties
-
getUnsignedSignatureProperties
protected SignatureProperties<CAdESAttribute> getUnsignedSignatureProperties()
Description copied from class:AbstractTimestampSourceReturns the 'unsigned-signature-properties' element of the signature- Specified by:
getUnsignedSignaturePropertiesin classAbstractTimestampSource<CAdESAttribute>- Returns:
SignatureProperties
-
isContentTimestamp
protected boolean isContentTimestamp(CAdESAttribute signedAttribute)
Description copied from class:AbstractTimestampSourceDetermines if the givensignedAttributeis an instance of "content-timestamp" element NOTE: Applicable only for CAdES- Specified by:
isContentTimestampin classAbstractTimestampSource<CAdESAttribute>- Parameters:
signedAttribute-ISignatureAttributeto process- Returns:
- TRUE if the
unsignedAttributeis a Data Objects Timestamp, FALSE otherwise
-
isAllDataObjectsTimestamp
protected boolean isAllDataObjectsTimestamp(CAdESAttribute signedAttribute)
Description copied from class:AbstractTimestampSourceDetermines if the givensignedAttributeis an instance of "data-objects-timestamp" element NOTE: Applicable only for XAdES- Specified by:
isAllDataObjectsTimestampin classAbstractTimestampSource<CAdESAttribute>- Parameters:
signedAttribute-ISignatureAttributeto process- Returns:
- TRUE if the
unsignedAttributeis a Data Objects Timestamp, FALSE otherwise
-
isIndividualDataObjectsTimestamp
protected boolean isIndividualDataObjectsTimestamp(CAdESAttribute signedAttribute)
Description copied from class:AbstractTimestampSourceDetermines if the givensignedAttributeis an instance of "individual-data-objects-timestamp" element NOTE: Applicable only for XAdES- Specified by:
isIndividualDataObjectsTimestampin classAbstractTimestampSource<CAdESAttribute>- Parameters:
signedAttribute-ISignatureAttributeto process- Returns:
- TRUE if the
unsignedAttributeis a Data Objects Timestamp, FALSE otherwise
-
isSignatureTimestamp
protected boolean isSignatureTimestamp(CAdESAttribute unsignedAttribute)
Description copied from class:AbstractTimestampSourceDetermines if the givenunsignedAttributeis an instance of "signature-timestamp" element- Specified by:
isSignatureTimestampin classAbstractTimestampSource<CAdESAttribute>- Parameters:
unsignedAttribute-ISignatureAttributeto process- Returns:
- TRUE if the
unsignedAttributeis a Signature Timestamp, FALSE otherwise
-
isCompleteCertificateRef
protected boolean isCompleteCertificateRef(CAdESAttribute unsignedAttribute)
Description copied from class:AbstractTimestampSourceDetermines if the givenunsignedAttributeis an instance of "complete-certificate-ref" element- Specified by:
isCompleteCertificateRefin classAbstractTimestampSource<CAdESAttribute>- Parameters:
unsignedAttribute-ISignatureAttributeto process- Returns:
- TRUE if the
unsignedAttributeis a Complete Certificate Ref, FALSE otherwise
-
isAttributeCertificateRef
protected boolean isAttributeCertificateRef(CAdESAttribute unsignedAttribute)
Description copied from class:AbstractTimestampSourceDetermines if the givenunsignedAttributeis an instance of "attribute-certificate-ref" element- Specified by:
isAttributeCertificateRefin classAbstractTimestampSource<CAdESAttribute>- Parameters:
unsignedAttribute-ISignatureAttributeto process- Returns:
- TRUE if the
unsignedAttributeis an Attribute Certificate Ref, FALSE otherwise
-
isCompleteRevocationRef
protected boolean isCompleteRevocationRef(CAdESAttribute unsignedAttribute)
Description copied from class:AbstractTimestampSourceDetermines if the givenunsignedAttributeis an instance of "complete-revocation-ref" element- Specified by:
isCompleteRevocationRefin classAbstractTimestampSource<CAdESAttribute>- Parameters:
unsignedAttribute-ISignatureAttributeto process- Returns:
- TRUE if the
unsignedAttributeis a Complete Revocation Ref, FALSE otherwise
-
isAttributeRevocationRef
protected boolean isAttributeRevocationRef(CAdESAttribute unsignedAttribute)
Description copied from class:AbstractTimestampSourceDetermines if the givenunsignedAttributeis an instance of "attribute-revocation-ref" element- Specified by:
isAttributeRevocationRefin classAbstractTimestampSource<CAdESAttribute>- Parameters:
unsignedAttribute-ISignatureAttributeto process- Returns:
- TRUE if the
unsignedAttributeis an Attribute Revocation Ref, FALSE otherwise
-
isRefsOnlyTimestamp
protected boolean isRefsOnlyTimestamp(CAdESAttribute unsignedAttribute)
Description copied from class:AbstractTimestampSourceDetermines if the givenunsignedAttributeis an instance of "refs-only-timestamp" element- Specified by:
isRefsOnlyTimestampin classAbstractTimestampSource<CAdESAttribute>- Parameters:
unsignedAttribute-ISignatureAttributeto process- Returns:
- TRUE if the
unsignedAttributeis a Refs Only TimeStamp, FALSE otherwise
-
isSigAndRefsTimestamp
protected boolean isSigAndRefsTimestamp(CAdESAttribute unsignedAttribute)
Description copied from class:AbstractTimestampSourceDetermines if the givenunsignedAttributeis an instance of "sig-and-refs-timestamp" element- Specified by:
isSigAndRefsTimestampin classAbstractTimestampSource<CAdESAttribute>- Parameters:
unsignedAttribute-ISignatureAttributeto process- Returns:
- TRUE if the
unsignedAttributeis a Sig And Refs TimeStamp, FALSE otherwise
-
isCertificateValues
protected boolean isCertificateValues(CAdESAttribute unsignedAttribute)
Description copied from class:AbstractTimestampSourceDetermines if the givenunsignedAttributeis an instance of "certificate-values" element- Specified by:
isCertificateValuesin classAbstractTimestampSource<CAdESAttribute>- Parameters:
unsignedAttribute-ISignatureAttributeto process- Returns:
- TRUE if the
unsignedAttributeis a Certificate Values, FALSE otherwise
-
isRevocationValues
protected boolean isRevocationValues(CAdESAttribute unsignedAttribute)
Description copied from class:AbstractTimestampSourceDetermines if the givenunsignedAttributeis an instance of "revocation-values" element- Specified by:
isRevocationValuesin classAbstractTimestampSource<CAdESAttribute>- Parameters:
unsignedAttribute-ISignatureAttributeto process- Returns:
- TRUE if the
unsignedAttributeis a Revocation Values, FALSE otherwise
-
isArchiveTimestamp
protected boolean isArchiveTimestamp(CAdESAttribute unsignedAttribute)
Description copied from class:AbstractTimestampSourceDetermines if the givenunsignedAttributeis an instance of "archive-timestamp" element- Specified by:
isArchiveTimestampin classAbstractTimestampSource<CAdESAttribute>- Parameters:
unsignedAttribute-ISignatureAttributeto process- Returns:
- TRUE if the
unsignedAttributeis an Archive TimeStamp, FALSE otherwise
-
isTimeStampValidationData
protected boolean isTimeStampValidationData(CAdESAttribute unsignedAttribute)
Description copied from class:AbstractTimestampSourceDetermines if the givenunsignedAttributeis an instance of "timestamp-validation-data" element- Specified by:
isTimeStampValidationDatain classAbstractTimestampSource<CAdESAttribute>- Parameters:
unsignedAttribute-ISignatureAttributeto process- Returns:
- TRUE if the
unsignedAttributeis a TimeStamp Validation Data, FALSE otherwise
-
makeTimestampToken
protected TimestampToken makeTimestampToken(CAdESAttribute signatureAttribute, TimestampType timestampType, List<TimestampedReference> references)
Description copied from class:AbstractTimestampSourceCreates a timestamp token from the providedsignatureAttribute- Specified by:
makeTimestampTokenin classAbstractTimestampSource<CAdESAttribute>- Parameters:
signatureAttribute-ISignatureAttributeto create timestamp fromtimestampType- a targetTimestampTypereferences- list ofTimestampedReferences covered by the current timestamp- Returns:
TimestampToken
-
getIndividualContentTimestampedReferences
protected List<TimestampedReference> getIndividualContentTimestampedReferences(CAdESAttribute signedAttribute)
Description copied from class:AbstractTimestampSourceReturns a list ofTimestampedReferences for an "individual-data-objects-timestamp" NOTE: Used only in XAdES- Specified by:
getIndividualContentTimestampedReferencesin classAbstractTimestampSource<CAdESAttribute>- Parameters:
signedAttribute-AbstractTimestampSource- Returns:
- a list of
TimestampedReferences
-
getSignedDataReferences
protected List<TimestampedReference> getSignedDataReferences(TimestampToken timestampToken)
Description copied from class:AbstractTimestampSourceReturns a list ofTimestampedReferences for the giventimestampTokenfound into signed properties of the signature NOTE: used only in CAdES. NeedstimestampTokento be initialized before- Overrides:
getSignedDataReferencesin classAbstractTimestampSource<CAdESAttribute>- Parameters:
timestampToken-TimestampTokento get SignedData references for- Returns:
- list of
TimestampedReferences
-
getSignatureSignedDataReferences
protected List<TimestampedReference> getSignatureSignedDataReferences()
Description copied from class:AbstractTimestampSourceReturns a list of allTimestampedReferences found into CMS SignedData of the signature NOTE: used only in ASiC-E CAdES- Overrides:
getSignatureSignedDataReferencesin classAbstractTimestampSource<CAdESAttribute>- Returns:
- list of
TimestampedReferences
-
getCertificateRefDigests
protected List<Digest> getCertificateRefDigests(CAdESAttribute unsignedAttribute)
Description copied from class:AbstractTimestampSourceReturns a list ofDigests from the givenunsignedAttribute- Specified by:
getCertificateRefDigestsin classAbstractTimestampSource<CAdESAttribute>- Parameters:
unsignedAttribute-AbstractTimestampSourceto get certRef Digests from- Returns:
- list of
Digests
-
getRevocationRefCRLDigests
protected List<Digest> getRevocationRefCRLDigests(CAdESAttribute unsignedAttribute)
Description copied from class:AbstractTimestampSourceReturns a list of CRL revocation refDigests from the givenunsignedAttribute- Specified by:
getRevocationRefCRLDigestsin classAbstractTimestampSource<CAdESAttribute>- Parameters:
unsignedAttribute-AbstractTimestampSourceto get CRLRef Digests from- Returns:
- list of
Digests
-
getRevocationRefOCSPDigests
protected List<Digest> getRevocationRefOCSPDigests(CAdESAttribute unsignedAttribute)
Description copied from class:AbstractTimestampSourceReturns a list of OCSP revocation refDigests from the givenunsignedAttribute- Specified by:
getRevocationRefOCSPDigestsin classAbstractTimestampSource<CAdESAttribute>- Parameters:
unsignedAttribute-AbstractTimestampSourceto get OCSPRef Digests from- Returns:
- list of
Digests
-
getEncapsulatedCertificateIdentifiers
protected List<EncapsulatedCertificateTokenIdentifier> getEncapsulatedCertificateIdentifiers(CAdESAttribute unsignedAttribute)
Description copied from class:AbstractTimestampSourceReturns a list ofEncapsulatedCertificateTokenIdentifiers obtained from the givenunsignedAttribute- Specified by:
getEncapsulatedCertificateIdentifiersin classAbstractTimestampSource<CAdESAttribute>- Parameters:
unsignedAttribute-AbstractTimestampSourceto get certificate identifiers from- Returns:
- list of
EncapsulatedCertificateTokenIdentifiers
-
getEncapsulatedCRLIdentifiers
protected List<CRLBinary> getEncapsulatedCRLIdentifiers(CAdESAttribute unsignedAttribute)
Description copied from class:AbstractTimestampSourceReturns a list ofCRLBinarys obtained from the givenunsignedAttribute- Specified by:
getEncapsulatedCRLIdentifiersin classAbstractTimestampSource<CAdESAttribute>- Parameters:
unsignedAttribute-AbstractTimestampSourceto get CRL identifiers from- Returns:
- list of
CRLBinarys
-
getEncapsulatedOCSPIdentifiers
protected List<OCSPResponseBinary> getEncapsulatedOCSPIdentifiers(CAdESAttribute unsignedAttribute)
Description copied from class:AbstractTimestampSourceReturns a list ofOCSPResponseBinarys obtained from the givenunsignedAttribute- Specified by:
getEncapsulatedOCSPIdentifiersin classAbstractTimestampSource<CAdESAttribute>- Parameters:
unsignedAttribute-AbstractTimestampSourceto get OCSP identifiers from- Returns:
- list of
OCSPResponseBinarys
-
getArchiveTimestampType
protected ArchiveTimestampType getArchiveTimestampType(CAdESAttribute unsignedAttribute)
Description copied from class:AbstractTimestampSourceReturnsArchiveTimestampTypefor the givenunsignedAttribute- Specified by:
getArchiveTimestampTypein classAbstractTimestampSource<CAdESAttribute>- Parameters:
unsignedAttribute-AbstractTimestampSourceto get archive timestamp type for
-
addEncapsulatedValuesFromTimestamp
protected void addEncapsulatedValuesFromTimestamp(List<TimestampedReference> references, TimestampToken timestampedTimestamp)
Description copied from class:AbstractTimestampSourceAdds to thereferenceslist all validation data embedded to thetimestampedTimestamp- Overrides:
addEncapsulatedValuesFromTimestampin classAbstractTimestampSource<CAdESAttribute>- Parameters:
references- list ofTimestampedReferences to extendtimestampedTimestamp-TimestampTokento extract embedded values from
-
-