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.CMSSignedData
cmsSignedData
protected List<DSSDocument>
detachedDocuments
protected org.bouncycastle.cms.SignerInformation
signerInformation
Fields 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 void
addEncapsulatedValuesFromTimestamp(List<TimestampedReference> references, TimestampToken timestampedTimestamp)
Adds to thereferences
list all validation data embedded to thetimestampedTimestamp
protected List<TimestampedReference>
getArchiveTimestampOtherReferences(TimestampToken timestampToken)
Returns a list ofTimestampedReference
s for the given archivetimestampToken
that cannot be extracted from signature attributes (signed or unsigned), depending on its format (signedData for CAdES or, keyInfo for XAdES)protected ArchiveTimestampType
getArchiveTimestampType(CAdESAttribute unsignedAttribute)
ReturnsArchiveTimestampType
for the givenunsignedAttribute
protected List<CertificateRef>
getCertificateRefs(CAdESAttribute unsignedAttribute)
Returns a list ofCertificateRef
s from the givenunsignedAttribute
protected List<CRLRef>
getCRLRefs(CAdESAttribute unsignedAttribute)
Returns a list of CRL revocation refs from the givenunsignedAttribute
protected List<Identifier>
getEncapsulatedCertificateIdentifiers(CAdESAttribute unsignedAttribute)
Returns a list ofIdentifier
s obtained from the givenunsignedAttribute
protected List<Identifier>
getEncapsulatedCRLIdentifiers(CAdESAttribute unsignedAttribute)
Returns a list ofIdentifier
s obtained from the givenunsignedAttribute
protected List<Identifier>
getEncapsulatedOCSPIdentifiers(CAdESAttribute unsignedAttribute)
Returns a list ofIdentifier
s obtained from the givenunsignedAttribute
protected List<TimestampedReference>
getIndividualContentTimestampedReferences(CAdESAttribute signedAttribute)
Returns a list ofTimestampedReference
s 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 givenunsignedAttribute
protected List<TimestampedReference>
getSignatureSignedDataReferences()
Returns a list of allTimestampedReference
s 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 CAdESTimestampDataBuilder
getTimestampDataBuilder()
Returns a relatedTimestampDataBuilder
protected SignatureProperties<CAdESAttribute>
getUnsignedSignatureProperties()
Returns the 'unsigned-signature-properties' element of the signatureprotected boolean
isAllDataObjectsTimestamp(CAdESAttribute signedAttribute)
Determines if the givensignedAttribute
is an instance of "data-objects-timestamp" element NOTE: Applicable only for XAdESprotected boolean
isArchiveTimestamp(CAdESAttribute unsignedAttribute)
Determines if the givenunsignedAttribute
is an instance of "archive-timestamp" elementprotected boolean
isAttrAuthoritiesCertValues(CAdESAttribute unsignedAttribute)
Determines if the givenunsignedAttribute
is an instance of "AttrAuthoritiesCertValues" elementprotected boolean
isAttributeCertificateRef(CAdESAttribute unsignedAttribute)
Determines if the givenunsignedAttribute
is an instance of "attribute-certificate-ref" elementprotected boolean
isAttributeRevocationRef(CAdESAttribute unsignedAttribute)
Determines if the givenunsignedAttribute
is an instance of "attribute-revocation-ref" elementprotected boolean
isAttributeRevocationValues(CAdESAttribute unsignedAttribute)
Determines if the givenunsignedAttribute
is an instance of "AttributeRevocationValues" elementprotected boolean
isCertificateValues(CAdESAttribute unsignedAttribute)
Determines if the givenunsignedAttribute
is an instance of "certificate-values" elementprotected boolean
isCompleteCertificateRef(CAdESAttribute unsignedAttribute)
Determines if the givenunsignedAttribute
is an instance of "complete-certificate-ref" elementprotected boolean
isCompleteRevocationRef(CAdESAttribute unsignedAttribute)
Determines if the givenunsignedAttribute
is an instance of "complete-revocation-ref" elementprotected boolean
isContentTimestamp(CAdESAttribute signedAttribute)
Determines if the givensignedAttribute
is an instance of "content-timestamp" element NOTE: Applicable only for CAdESprotected boolean
isIndividualDataObjectsTimestamp(CAdESAttribute signedAttribute)
Determines if the givensignedAttribute
is an instance of "individual-data-objects-timestamp" element NOTE: Applicable only for XAdESprotected boolean
isRefsOnlyTimestamp(CAdESAttribute unsignedAttribute)
Determines if the givenunsignedAttribute
is an instance of "refs-only-timestamp" elementprotected boolean
isRevocationValues(CAdESAttribute unsignedAttribute)
Determines if the givenunsignedAttribute
is an instance of "revocation-values" elementprotected boolean
isSigAndRefsTimestamp(CAdESAttribute unsignedAttribute)
Determines if the givenunsignedAttribute
is an instance of "sig-and-refs-timestamp" elementprotected boolean
isSignatureTimestamp(CAdESAttribute unsignedAttribute)
Determines if the givenunsignedAttribute
is an instance of "signature-timestamp" elementprotected boolean
isTimeStampValidationData(CAdESAttribute unsignedAttribute)
Determines if the givenunsignedAttribute
is an instance of "timestamp-validation-data" elementprotected TimestampToken
makeTimestampToken(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, 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:AbstractTimestampSource
Returns a relatedTimestampDataBuilder
- Specified by:
getTimestampDataBuilder
in classAbstractTimestampSource<CAdESAttribute>
- Returns:
TimestampDataBuilder
-
getSignedSignatureProperties
Description copied from class:AbstractTimestampSource
Returns the 'signed-signature-properties' element of the signature- Specified by:
getSignedSignatureProperties
in classAbstractTimestampSource<CAdESAttribute>
- Returns:
SignatureProperties
-
getUnsignedSignatureProperties
Description copied from class:AbstractTimestampSource
Returns the 'unsigned-signature-properties' element of the signature- Specified by:
getUnsignedSignatureProperties
in classAbstractTimestampSource<CAdESAttribute>
- Returns:
SignatureProperties
-
isContentTimestamp
Description copied from class:AbstractTimestampSource
Determines if the givensignedAttribute
is an instance of "content-timestamp" element NOTE: Applicable only for CAdES- Specified by:
isContentTimestamp
in classAbstractTimestampSource<CAdESAttribute>
- Parameters:
signedAttribute
-ISignatureAttribute
to process- Returns:
- TRUE if the
unsignedAttribute
is a Data Objects Timestamp, FALSE otherwise
-
isAllDataObjectsTimestamp
Description copied from class:AbstractTimestampSource
Determines if the givensignedAttribute
is an instance of "data-objects-timestamp" element NOTE: Applicable only for XAdES- Specified by:
isAllDataObjectsTimestamp
in classAbstractTimestampSource<CAdESAttribute>
- Parameters:
signedAttribute
-ISignatureAttribute
to process- Returns:
- TRUE if the
unsignedAttribute
is a Data Objects Timestamp, FALSE otherwise
-
isIndividualDataObjectsTimestamp
Description copied from class:AbstractTimestampSource
Determines if the givensignedAttribute
is an instance of "individual-data-objects-timestamp" element NOTE: Applicable only for XAdES- Specified by:
isIndividualDataObjectsTimestamp
in classAbstractTimestampSource<CAdESAttribute>
- Parameters:
signedAttribute
-ISignatureAttribute
to process- Returns:
- TRUE if the
unsignedAttribute
is a Data Objects Timestamp, FALSE otherwise
-
isSignatureTimestamp
Description copied from class:AbstractTimestampSource
Determines if the givenunsignedAttribute
is an instance of "signature-timestamp" element- Specified by:
isSignatureTimestamp
in classAbstractTimestampSource<CAdESAttribute>
- Parameters:
unsignedAttribute
-ISignatureAttribute
to process- Returns:
- TRUE if the
unsignedAttribute
is a Signature Timestamp, FALSE otherwise
-
isCompleteCertificateRef
Description copied from class:AbstractTimestampSource
Determines if the givenunsignedAttribute
is an instance of "complete-certificate-ref" element- Specified by:
isCompleteCertificateRef
in classAbstractTimestampSource<CAdESAttribute>
- Parameters:
unsignedAttribute
-ISignatureAttribute
to process- Returns:
- TRUE if the
unsignedAttribute
is a Complete Certificate Ref, FALSE otherwise
-
isAttributeCertificateRef
Description copied from class:AbstractTimestampSource
Determines if the givenunsignedAttribute
is an instance of "attribute-certificate-ref" element- Specified by:
isAttributeCertificateRef
in classAbstractTimestampSource<CAdESAttribute>
- Parameters:
unsignedAttribute
-ISignatureAttribute
to process- Returns:
- TRUE if the
unsignedAttribute
is an Attribute Certificate Ref, FALSE otherwise
-
isCompleteRevocationRef
Description copied from class:AbstractTimestampSource
Determines if the givenunsignedAttribute
is an instance of "complete-revocation-ref" element- Specified by:
isCompleteRevocationRef
in classAbstractTimestampSource<CAdESAttribute>
- Parameters:
unsignedAttribute
-ISignatureAttribute
to process- Returns:
- TRUE if the
unsignedAttribute
is a Complete Revocation Ref, FALSE otherwise
-
isAttributeRevocationRef
Description copied from class:AbstractTimestampSource
Determines if the givenunsignedAttribute
is an instance of "attribute-revocation-ref" element- Specified by:
isAttributeRevocationRef
in classAbstractTimestampSource<CAdESAttribute>
- Parameters:
unsignedAttribute
-ISignatureAttribute
to process- Returns:
- TRUE if the
unsignedAttribute
is an Attribute Revocation Ref, FALSE otherwise
-
isRefsOnlyTimestamp
Description copied from class:AbstractTimestampSource
Determines if the givenunsignedAttribute
is an instance of "refs-only-timestamp" element- Specified by:
isRefsOnlyTimestamp
in classAbstractTimestampSource<CAdESAttribute>
- Parameters:
unsignedAttribute
-ISignatureAttribute
to process- Returns:
- TRUE if the
unsignedAttribute
is a Refs Only TimeStamp, FALSE otherwise
-
isSigAndRefsTimestamp
Description copied from class:AbstractTimestampSource
Determines if the givenunsignedAttribute
is an instance of "sig-and-refs-timestamp" element- Specified by:
isSigAndRefsTimestamp
in classAbstractTimestampSource<CAdESAttribute>
- Parameters:
unsignedAttribute
-ISignatureAttribute
to process- Returns:
- TRUE if the
unsignedAttribute
is a Sig And Refs TimeStamp, FALSE otherwise
-
isCertificateValues
Description copied from class:AbstractTimestampSource
Determines if the givenunsignedAttribute
is an instance of "certificate-values" element- Specified by:
isCertificateValues
in classAbstractTimestampSource<CAdESAttribute>
- Parameters:
unsignedAttribute
-ISignatureAttribute
to process- Returns:
- TRUE if the
unsignedAttribute
is a Certificate Values, FALSE otherwise
-
isRevocationValues
Description copied from class:AbstractTimestampSource
Determines if the givenunsignedAttribute
is an instance of "revocation-values" element- Specified by:
isRevocationValues
in classAbstractTimestampSource<CAdESAttribute>
- Parameters:
unsignedAttribute
-ISignatureAttribute
to process- Returns:
- TRUE if the
unsignedAttribute
is a Revocation Values, FALSE otherwise
-
isAttrAuthoritiesCertValues
Description copied from class:AbstractTimestampSource
Determines if the givenunsignedAttribute
is an instance of "AttrAuthoritiesCertValues" element- Specified by:
isAttrAuthoritiesCertValues
in classAbstractTimestampSource<CAdESAttribute>
- Parameters:
unsignedAttribute
-ISignatureAttribute
to process- Returns:
- TRUE if the
unsignedAttribute
is an AttrAuthoritiesCertValues, FALSE otherwise
-
isAttributeRevocationValues
Description copied from class:AbstractTimestampSource
Determines if the givenunsignedAttribute
is an instance of "AttributeRevocationValues" element- Specified by:
isAttributeRevocationValues
in classAbstractTimestampSource<CAdESAttribute>
- Parameters:
unsignedAttribute
-ISignatureAttribute
to process- Returns:
- TRUE if the
unsignedAttribute
is an AttributeRevocationValues, FALSE otherwise
-
isArchiveTimestamp
Description copied from class:AbstractTimestampSource
Determines if the givenunsignedAttribute
is an instance of "archive-timestamp" element- Specified by:
isArchiveTimestamp
in classAbstractTimestampSource<CAdESAttribute>
- Parameters:
unsignedAttribute
-ISignatureAttribute
to process- Returns:
- TRUE if the
unsignedAttribute
is an Archive TimeStamp, FALSE otherwise
-
isTimeStampValidationData
Description copied from class:AbstractTimestampSource
Determines if the givenunsignedAttribute
is an instance of "timestamp-validation-data" element- Specified by:
isTimeStampValidationData
in classAbstractTimestampSource<CAdESAttribute>
- Parameters:
unsignedAttribute
-ISignatureAttribute
to process- Returns:
- TRUE if the
unsignedAttribute
is a TimeStamp Validation Data, FALSE otherwise
-
makeTimestampToken
protected TimestampToken makeTimestampToken(CAdESAttribute signatureAttribute, TimestampType timestampType, List<TimestampedReference> references)Description copied from class:AbstractTimestampSource
Creates a timestamp token from the providedsignatureAttribute
- Specified by:
makeTimestampToken
in classAbstractTimestampSource<CAdESAttribute>
- Parameters:
signatureAttribute
-ISignatureAttribute
to create timestamp fromtimestampType
- a targetTimestampType
references
- list ofTimestampedReference
s covered by the current timestamp- Returns:
TimestampToken
-
getIndividualContentTimestampedReferences
protected List<TimestampedReference> getIndividualContentTimestampedReferences(CAdESAttribute signedAttribute)Description copied from class:AbstractTimestampSource
Returns a list ofTimestampedReference
s for an "individual-data-objects-timestamp" NOTE: Used only in XAdES- Specified by:
getIndividualContentTimestampedReferences
in classAbstractTimestampSource<CAdESAttribute>
- Parameters:
signedAttribute
-AbstractTimestampSource
- Returns:
- a list of
TimestampedReference
s
-
getArchiveTimestampOtherReferences
protected List<TimestampedReference> getArchiveTimestampOtherReferences(TimestampToken timestampToken)Description copied from class:AbstractTimestampSource
Returns a list ofTimestampedReference
s for the given archivetimestampToken
that cannot be extracted from signature attributes (signed or unsigned), depending on its format (signedData for CAdES or, keyInfo for XAdES)- Specified by:
getArchiveTimestampOtherReferences
in classAbstractTimestampSource<CAdESAttribute>
- Parameters:
timestampToken
-TimestampToken
to get archive timestamp references for- Returns:
- list of
TimestampedReference
s
-
getSignedDataReferences
-
getSignatureSignedDataReferences
Description copied from class:AbstractTimestampSource
Returns a list of allTimestampedReference
s found into CMS SignedData of the signature NOTE: used only in ASiC-E CAdES- Overrides:
getSignatureSignedDataReferences
in classAbstractTimestampSource<CAdESAttribute>
- Returns:
- list of
TimestampedReference
s
-
getCertificateRefs
Description copied from class:AbstractTimestampSource
Returns a list ofCertificateRef
s from the givenunsignedAttribute
- Specified by:
getCertificateRefs
in classAbstractTimestampSource<CAdESAttribute>
- Parameters:
unsignedAttribute
-AbstractTimestampSource
to get certRefs from- Returns:
- list of
CertificateRef
s
-
getCRLRefs
Description copied from class:AbstractTimestampSource
Returns a list of CRL revocation refs from the givenunsignedAttribute
- Specified by:
getCRLRefs
in classAbstractTimestampSource<CAdESAttribute>
- Parameters:
unsignedAttribute
-AbstractTimestampSource
to get CRLRef- Returns:
- list of
CRLRef
s
-
getOCSPRefs
Description copied from class:AbstractTimestampSource
Returns a list of OCSP revocation refs from the givenunsignedAttribute
- Specified by:
getOCSPRefs
in classAbstractTimestampSource<CAdESAttribute>
- Parameters:
unsignedAttribute
-AbstractTimestampSource
to get OCSPRefs from- Returns:
- list of
OCSPRef
s
-
getEncapsulatedCertificateIdentifiers
Description copied from class:AbstractTimestampSource
Returns a list ofIdentifier
s obtained from the givenunsignedAttribute
- Specified by:
getEncapsulatedCertificateIdentifiers
in classAbstractTimestampSource<CAdESAttribute>
- Parameters:
unsignedAttribute
-AbstractTimestampSource
to get certificate identifiers from- Returns:
- list of
Identifier
s
-
getEncapsulatedCRLIdentifiers
Description copied from class:AbstractTimestampSource
Returns a list ofIdentifier
s obtained from the givenunsignedAttribute
- Specified by:
getEncapsulatedCRLIdentifiers
in classAbstractTimestampSource<CAdESAttribute>
- Parameters:
unsignedAttribute
-AbstractTimestampSource
to get CRL identifiers from- Returns:
- list of
Identifier
s
-
getEncapsulatedOCSPIdentifiers
Description copied from class:AbstractTimestampSource
Returns a list ofIdentifier
s obtained from the givenunsignedAttribute
- Specified by:
getEncapsulatedOCSPIdentifiers
in classAbstractTimestampSource<CAdESAttribute>
- Parameters:
unsignedAttribute
-AbstractTimestampSource
to get OCSP identifiers from- Returns:
- list of
Identifier
s
-
getArchiveTimestampType
Description copied from class:AbstractTimestampSource
ReturnsArchiveTimestampType
for the givenunsignedAttribute
- Specified by:
getArchiveTimestampType
in classAbstractTimestampSource<CAdESAttribute>
- Parameters:
unsignedAttribute
-AbstractTimestampSource
to get archive timestamp type for
-
addEncapsulatedValuesFromTimestamp
protected void addEncapsulatedValuesFromTimestamp(List<TimestampedReference> references, TimestampToken timestampedTimestamp)Description copied from class:AbstractTimestampSource
Adds to thereferences
list all validation data embedded to thetimestampedTimestamp
- Overrides:
addEncapsulatedValuesFromTimestamp
in classAbstractTimestampSource<CAdESAttribute>
- Parameters:
references
- list ofTimestampedReference
s to extendtimestampedTimestamp
-TimestampToken
to extract embedded values from
-