Class XAdESTimestampSource
java.lang.Object
eu.europa.esig.dss.validation.timestamp.AbstractTimestampSource<XAdESAttribute>
eu.europa.esig.dss.xades.validation.XAdESTimestampSource
- All Implemented Interfaces:
TimestampSource,Serializable
public class XAdESTimestampSource extends AbstractTimestampSource<XAdESAttribute>
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from class eu.europa.esig.dss.validation.timestamp.AbstractTimestampSource
certificateSource, crlSource, ocspSource, signatureCertificateSource, signatureCRLSource, signatureId, signatureOCSPSource, signatureScopes -
Constructor Summary
Constructors Constructor Description XAdESTimestampSource(XAdESSignature signature, Element signatureElement, XAdESPaths xadesPaths) -
Method Summary
Modifier and Type Method Description byte[]getArchiveTimestampData(String canonicalizationMethod)Returns concatenated data for an ArchiveTimestampprotected 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(XAdESAttribute unsignedAttribute)ReturnsArchiveTimestampTypefor the givenunsignedAttributeprotected List<CertificateRef>getCertificateRefs(XAdESAttribute unsignedAttribute)Returns a list ofCertificateRefs from the givenunsignedAttributeprotected List<CRLRef>getCRLRefs(XAdESAttribute unsignedAttribute)Returns a list of CRL revocation refs from the givenunsignedAttributeprotected List<Identifier>getEncapsulatedCertificateIdentifiers(XAdESAttribute unsignedAttribute)Returns a list ofIdentifiers obtained from the givenunsignedAttributeprotected List<Identifier>getEncapsulatedCRLIdentifiers(XAdESAttribute unsignedAttribute)Returns a list ofIdentifiers obtained from the givenunsignedAttributeprotected List<Identifier>getEncapsulatedOCSPIdentifiers(XAdESAttribute unsignedAttribute)Returns a list ofIdentifiers obtained from the givenunsignedAttributeprotected List<TimestampedReference>getIndividualContentTimestampedReferences(XAdESAttribute signedAttribute)Returns a list ofTimestampedReferences for an "individual-data-objects-timestamp" NOTE: Used only in XAdESprotected List<TimestampedReference>getKeyInfoReferences()protected List<OCSPRef>getOCSPRefs(XAdESAttribute unsignedAttribute)Returns a list of OCSP revocation refs from the givenunsignedAttributebyte[]getSignatureTimestampData(String canonicalizationMethod)Returns concatenated data for a SignatureTimestampList<TimestampedReference>getSignatureTimestampReferences()Returns a list ofTimestampedReferencefor a "signature-timestamp" elementprotected SignatureProperties<XAdESAttribute>getSignedSignatureProperties()Returns the 'signed-signature-properties' element of the signatureprotected XAdESTimestampDataBuildergetTimestampDataBuilder()Returns a relatedTimestampDataBuilderbyte[]getTimestampX1Data(String canonicalizationMethod)Returns concatenated data for a SigAndRefsTimestampbyte[]getTimestampX2Data(String canonicalizationMethod)Returns concatenated data for a RefsOnlyTimestampprotected SignatureProperties<XAdESAttribute>getUnsignedSignatureProperties()Returns the 'unsigned-signature-properties' element of the signatureprotected booleanisAllDataObjectsTimestamp(XAdESAttribute signedAttribute)Determines if the givensignedAttributeis an instance of "data-objects-timestamp" element NOTE: Applicable only for XAdESprotected booleanisArchiveTimestamp(XAdESAttribute unsignedAttribute)Determines if the givenunsignedAttributeis an instance of "archive-timestamp" elementprotected booleanisAttrAuthoritiesCertValues(XAdESAttribute unsignedAttribute)Determines if the givenunsignedAttributeis an instance of "AttrAuthoritiesCertValues" elementprotected booleanisAttributeCertificateRef(XAdESAttribute unsignedAttribute)Determines if the givenunsignedAttributeis an instance of "attribute-certificate-ref" elementprotected booleanisAttributeRevocationRef(XAdESAttribute unsignedAttribute)Determines if the givenunsignedAttributeis an instance of "attribute-revocation-ref" elementprotected booleanisAttributeRevocationValues(XAdESAttribute unsignedAttribute)Determines if the givenunsignedAttributeis an instance of "AttributeRevocationValues" elementprotected booleanisCertificateValues(XAdESAttribute unsignedAttribute)Determines if the givenunsignedAttributeis an instance of "certificate-values" elementprotected booleanisCompleteCertificateRef(XAdESAttribute unsignedAttribute)Determines if the givenunsignedAttributeis an instance of "complete-certificate-ref" elementprotected booleanisCompleteRevocationRef(XAdESAttribute unsignedAttribute)Determines if the givenunsignedAttributeis an instance of "complete-revocation-ref" elementprotected booleanisContentTimestamp(XAdESAttribute signedAttribute)Determines if the givensignedAttributeis an instance of "content-timestamp" element NOTE: Applicable only for CAdESprotected booleanisIndividualDataObjectsTimestamp(XAdESAttribute signedAttribute)Determines if the givensignedAttributeis an instance of "individual-data-objects-timestamp" element NOTE: Applicable only for XAdESprotected booleanisRefsOnlyTimestamp(XAdESAttribute unsignedAttribute)Determines if the givenunsignedAttributeis an instance of "refs-only-timestamp" elementprotected booleanisRevocationValues(XAdESAttribute unsignedAttribute)Determines if the givenunsignedAttributeis an instance of "revocation-values" elementprotected booleanisSigAndRefsTimestamp(XAdESAttribute unsignedAttribute)Determines if the givenunsignedAttributeis an instance of "sig-and-refs-timestamp" elementprotected booleanisSignatureTimestamp(XAdESAttribute unsignedAttribute)Determines if the givenunsignedAttributeis an instance of "signature-timestamp" elementprotected booleanisTimeStampValidationData(XAdESAttribute unsignedAttribute)Determines if the givenunsignedAttributeis an instance of "timestamp-validation-data" elementprotected TimestampTokenmakeTimestampToken(XAdESAttribute unsignedAttribute, TimestampType timestampType, List<TimestampedReference> references)Creates a timestamp token from the providedsignatureAttributeMethods inherited from class eu.europa.esig.dss.validation.timestamp.AbstractTimestampSource
addEncapsulatedValuesFromTimestamp, addExternalTimestamp, addReference, addReference, addReferences, addReferencesForPreviousTimestamps, createAndValidate, createReferencesForCertificates, getAllSignedDataReferences, getAllTimestamps, getArchiveTimestamps, getContentTimestamps, getDocumentTimestamps, getSignatureSignedDataReferences, getSignatureTimestamps, getSigningCertificateTimestampReferences, getTimestampCertificateSources, getTimestampCertificateSourcesExceptLastArchiveTimestamp, getTimestampCRLSources, getTimestampedCertificateRefs, getTimestampedCertificateValues, getTimestampedRevocationRefs, getTimestampedRevocationValues, getTimestampOCSPSources, getTimestampsX1, getTimestampsX2, getTimestampValidationData, makeTimestampTokens, populateSources, validateTimestamps
-
Constructor Details
-
XAdESTimestampSource
public XAdESTimestampSource(XAdESSignature signature, Element signatureElement, XAdESPaths xadesPaths)
-
-
Method Details
-
getSignedSignatureProperties
Description copied from class:AbstractTimestampSourceReturns the 'signed-signature-properties' element of the signature- Specified by:
getSignedSignaturePropertiesin classAbstractTimestampSource<XAdESAttribute>- Returns:
SignatureProperties
-
getUnsignedSignatureProperties
Description copied from class:AbstractTimestampSourceReturns the 'unsigned-signature-properties' element of the signature- Specified by:
getUnsignedSignaturePropertiesin classAbstractTimestampSource<XAdESAttribute>- Returns:
SignatureProperties
-
getTimestampDataBuilder
Description copied from class:AbstractTimestampSourceReturns a relatedTimestampDataBuilder- Specified by:
getTimestampDataBuilderin classAbstractTimestampSource<XAdESAttribute>- Returns:
TimestampDataBuilder
-
getSignatureTimestampData
Returns concatenated data for a SignatureTimestamp- Parameters:
canonicalizationMethod-Stringcanonicalization method to use- Returns:
- byte array
-
getTimestampX1Data
Returns concatenated data for a SigAndRefsTimestamp- Parameters:
canonicalizationMethod-Stringcanonicalization method to use- Returns:
- byte array
-
getTimestampX2Data
Returns concatenated data for a RefsOnlyTimestamp- Parameters:
canonicalizationMethod-Stringcanonicalization method to use- Returns:
- byte array
-
getArchiveTimestampData
Returns concatenated data for an ArchiveTimestamp- Parameters:
canonicalizationMethod-Stringcanonicalization method to use- Returns:
- byte array
-
isContentTimestamp
Description copied from class:AbstractTimestampSourceDetermines if the givensignedAttributeis an instance of "content-timestamp" element NOTE: Applicable only for CAdES- Specified by:
isContentTimestampin classAbstractTimestampSource<XAdESAttribute>- 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<XAdESAttribute>- 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<XAdESAttribute>- 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<XAdESAttribute>- 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<XAdESAttribute>- 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<XAdESAttribute>- 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<XAdESAttribute>- 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<XAdESAttribute>- 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<XAdESAttribute>- 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<XAdESAttribute>- 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<XAdESAttribute>- 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<XAdESAttribute>- 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<XAdESAttribute>- 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<XAdESAttribute>- 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<XAdESAttribute>- 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<XAdESAttribute>- Parameters:
unsignedAttribute-ISignatureAttributeto process- Returns:
- TRUE if the
unsignedAttributeis a TimeStamp Validation Data, FALSE otherwise
-
makeTimestampToken
protected TimestampToken makeTimestampToken(XAdESAttribute unsignedAttribute, TimestampType timestampType, List<TimestampedReference> references)Description copied from class:AbstractTimestampSourceCreates a timestamp token from the providedsignatureAttribute- Specified by:
makeTimestampTokenin classAbstractTimestampSource<XAdESAttribute>- Parameters:
unsignedAttribute-ISignatureAttributeto create timestamp fromtimestampType- a targetTimestampTypereferences- list ofTimestampedReferences covered by the current timestamp- Returns:
TimestampToken
-
getIndividualContentTimestampedReferences
protected List<TimestampedReference> getIndividualContentTimestampedReferences(XAdESAttribute signedAttribute)Description copied from class:AbstractTimestampSourceReturns a list ofTimestampedReferences for an "individual-data-objects-timestamp" NOTE: Used only in XAdES- Specified by:
getIndividualContentTimestampedReferencesin classAbstractTimestampSource<XAdESAttribute>- 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<XAdESAttribute>- Parameters:
timestampToken-TimestampTokento get archive timestamp references for- Returns:
- list of
TimestampedReferences
-
getSignatureTimestampReferences
Description copied from class:AbstractTimestampSourceReturns a list ofTimestampedReferencefor a "signature-timestamp" element- Overrides:
getSignatureTimestampReferencesin classAbstractTimestampSource<XAdESAttribute>- Returns:
- list of
TimestampedReferences
-
getKeyInfoReferences
-
getCertificateRefs
Description copied from class:AbstractTimestampSourceReturns a list ofCertificateRefs from the givenunsignedAttribute- Specified by:
getCertificateRefsin classAbstractTimestampSource<XAdESAttribute>- 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<XAdESAttribute>- 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<XAdESAttribute>- 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<XAdESAttribute>- 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<XAdESAttribute>- 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<XAdESAttribute>- Parameters:
unsignedAttribute-AbstractTimestampSourceto get OCSP identifiers from- Returns:
- list of
Identifiers
-
getArchiveTimestampType
Description copied from class:AbstractTimestampSourceReturnsArchiveTimestampTypefor the givenunsignedAttribute- Specified by:
getArchiveTimestampTypein classAbstractTimestampSource<XAdESAttribute>- Parameters:
unsignedAttribute-AbstractTimestampSourceto get archive timestamp type for
-