Class CAdESTimestampSource
java.lang.Object
eu.europa.esig.dss.validation.timestamp.AbstractTimestampSource<CAdESAttribute>
eu.europa.esig.dss.cades.validation.CAdESTimestampSource
- All Implemented Interfaces:
TimestampSource,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.SignerInformationsignerInformationFields inherited from class eu.europa.esig.dss.validation.timestamp.AbstractTimestampSource
certificateSource, crlSource, ocspSource, signatureCertificateSource, signatureCRLSource, signatureId, signatureOCSPSource, signatureScopes -
Constructor Summary
Constructors Constructor Description CAdESTimestampSource(CAdESSignature signature) -
Method Summary
Modifier and Type Method Description protected voidaddEncapsulatedValuesFromTimestamp(List<TimestampedReference> references, TimestampToken timestampedTimestamp)Adds to thereferenceslist all validation data embedded to thetimestampedTimestampprotected List<TimestampedReference>getArchiveTimestampOtherReferences(TimestampToken timestampToken)Returns a list ofTimestampedReferences for the given archivetimestampTokenthat cannot be extracted from signature attributes (signed or unsigned), depending on its format (signedData for CAdES or, keyInfo for XAdES)protected ArchiveTimestampTypegetArchiveTimestampType(CAdESAttribute unsignedAttribute)ReturnsArchiveTimestampTypefor the givenunsignedAttributeprotected List<CertificateRef>getCertificateRefs(CAdESAttribute unsignedAttribute)Returns a list ofCertificateRefs from the givenunsignedAttributeprotected List<CRLRef>getCRLRefs(CAdESAttribute unsignedAttribute)Returns a list of CRL revocation refs from the givenunsignedAttributeprotected List<Identifier>getEncapsulatedCertificateIdentifiers(CAdESAttribute unsignedAttribute)Returns a list ofIdentifiers obtained from the givenunsignedAttributeprotected List<Identifier>getEncapsulatedCRLIdentifiers(CAdESAttribute unsignedAttribute)Returns a list ofIdentifiers obtained from the givenunsignedAttributeprotected List<Identifier>getEncapsulatedOCSPIdentifiers(CAdESAttribute unsignedAttribute)Returns a list ofIdentifiers 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<OCSPRef>getOCSPRefs(CAdESAttribute unsignedAttribute)Returns a list of OCSP revocation refs 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)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 booleanisAttrAuthoritiesCertValues(CAdESAttribute unsignedAttribute)Determines if the givenunsignedAttributeis an instance of "AttrAuthoritiesCertValues" 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 booleanisAttributeRevocationValues(CAdESAttribute unsignedAttribute)Determines if the givenunsignedAttributeis an instance of "AttributeRevocationValues" 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 providedsignatureAttributeMethods inherited from class eu.europa.esig.dss.validation.timestamp.AbstractTimestampSource
addExternalTimestamp, addReference, addReference, addReferences, addReferencesForPreviousTimestamps, createAndValidate, createReferencesForCertificates, getAllSignedDataReferences, getAllTimestamps, getArchiveTimestamps, getContentTimestamps, getDocumentTimestamps, getSignatureTimestampReferences, getSignatureTimestamps, getSigningCertificateTimestampReferences, getTimestampCertificateSources, getTimestampCertificateSourcesExceptLastArchiveTimestamp, getTimestampCRLSources, getTimestampedCertificateRefs, getTimestampedCertificateValues, getTimestampedRevocationRefs, getTimestampedRevocationValues, getTimestampOCSPSources, getTimestampsX1, getTimestampsX2, getTimestampValidationData, makeTimestampTokens, populateSources, validateTimestamps
-
Field Details
-
signerInformation
protected final transient org.bouncycastle.cms.SignerInformation signerInformation -
cmsSignedData
protected final transient org.bouncycastle.cms.CMSSignedData cmsSignedData -
detachedDocuments
-
-
Constructor Details
-
Method Details
-
getTimestampDataBuilder
Description copied from class:AbstractTimestampSourceReturns a relatedTimestampDataBuilder- Specified by:
getTimestampDataBuilderin classAbstractTimestampSource<CAdESAttribute>- Returns:
TimestampDataBuilder
-
getSignedSignatureProperties
Description copied from class:AbstractTimestampSourceReturns the 'signed-signature-properties' element of the signature- Specified by:
getSignedSignaturePropertiesin classAbstractTimestampSource<CAdESAttribute>- Returns:
SignatureProperties
-
getUnsignedSignatureProperties
Description copied from class:AbstractTimestampSourceReturns the 'unsigned-signature-properties' element of the signature- Specified by:
getUnsignedSignaturePropertiesin classAbstractTimestampSource<CAdESAttribute>- Returns:
SignatureProperties
-
isContentTimestamp
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
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
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
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
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
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
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
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
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
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
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
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
-
isAttrAuthoritiesCertValues
Description copied from class:AbstractTimestampSourceDetermines if the givenunsignedAttributeis an instance of "AttrAuthoritiesCertValues" element- Specified by:
isAttrAuthoritiesCertValuesin classAbstractTimestampSource<CAdESAttribute>- Parameters:
unsignedAttribute-ISignatureAttributeto process- Returns:
- TRUE if the
unsignedAttributeis an AttrAuthoritiesCertValues, FALSE otherwise
-
isAttributeRevocationValues
Description copied from class:AbstractTimestampSourceDetermines if the givenunsignedAttributeis an instance of "AttributeRevocationValues" element- Specified by:
isAttributeRevocationValuesin classAbstractTimestampSource<CAdESAttribute>- Parameters:
unsignedAttribute-ISignatureAttributeto process- Returns:
- TRUE if the
unsignedAttributeis an AttributeRevocationValues, FALSE otherwise
-
isArchiveTimestamp
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
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
-
getArchiveTimestampOtherReferences
protected List<TimestampedReference> getArchiveTimestampOtherReferences(TimestampToken timestampToken)Description copied from class:AbstractTimestampSourceReturns a list ofTimestampedReferences for the given archivetimestampTokenthat cannot be extracted from signature attributes (signed or unsigned), depending on its format (signedData for CAdES or, keyInfo for XAdES)- Specified by:
getArchiveTimestampOtherReferencesin classAbstractTimestampSource<CAdESAttribute>- Parameters:
timestampToken-TimestampTokento get archive timestamp references for- Returns:
- list of
TimestampedReferences
-
getSignedDataReferences
-
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
-
getCertificateRefs
Description copied from class:AbstractTimestampSourceReturns a list ofCertificateRefs from the givenunsignedAttribute- Specified by:
getCertificateRefsin classAbstractTimestampSource<CAdESAttribute>- Parameters:
unsignedAttribute-AbstractTimestampSourceto get certRefs from- Returns:
- list of
CertificateRefs
-
getCRLRefs
Description copied from class:AbstractTimestampSourceReturns a list of CRL revocation refs from the givenunsignedAttribute- Specified by:
getCRLRefsin classAbstractTimestampSource<CAdESAttribute>- Parameters:
unsignedAttribute-AbstractTimestampSourceto get CRLRef- Returns:
- list of
CRLRefs
-
getOCSPRefs
Description copied from class:AbstractTimestampSourceReturns a list of OCSP revocation refs from the givenunsignedAttribute- Specified by:
getOCSPRefsin classAbstractTimestampSource<CAdESAttribute>- Parameters:
unsignedAttribute-AbstractTimestampSourceto get OCSPRefs from- Returns:
- list of
OCSPRefs
-
getEncapsulatedCertificateIdentifiers
Description copied from class:AbstractTimestampSourceReturns a list ofIdentifiers obtained from the givenunsignedAttribute- Specified by:
getEncapsulatedCertificateIdentifiersin classAbstractTimestampSource<CAdESAttribute>- Parameters:
unsignedAttribute-AbstractTimestampSourceto get certificate identifiers from- Returns:
- list of
Identifiers
-
getEncapsulatedCRLIdentifiers
Description copied from class:AbstractTimestampSourceReturns a list ofIdentifiers obtained from the givenunsignedAttribute- Specified by:
getEncapsulatedCRLIdentifiersin classAbstractTimestampSource<CAdESAttribute>- Parameters:
unsignedAttribute-AbstractTimestampSourceto get CRL identifiers from- Returns:
- list of
Identifiers
-
getEncapsulatedOCSPIdentifiers
Description copied from class:AbstractTimestampSourceReturns a list ofIdentifiers obtained from the givenunsignedAttribute- Specified by:
getEncapsulatedOCSPIdentifiersin classAbstractTimestampSource<CAdESAttribute>- Parameters:
unsignedAttribute-AbstractTimestampSourceto get OCSP identifiers from- Returns:
- list of
Identifiers
-
getArchiveTimestampType
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
-