Class XAdESTimestampSource
- java.lang.Object
-
- eu.europa.esig.dss.validation.timestamp.AbstractTimestampSource<XAdESAttribute>
-
- eu.europa.esig.dss.xades.validation.XAdESTimestampSource
-
- All Implemented Interfaces:
SignatureTimestampSource,Serializable
public class XAdESTimestampSource extends AbstractTimestampSource<XAdESAttribute>
- See Also:
- Serialized Form
-
-
Field Summary
-
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 XAdESTimestampSource(XAdESSignature signature, Element signatureElement, XPathQueryHolder xPathQueryHolder, CertificatePool certificatePool)
-
Method Summary
Modifier and Type Method Description byte[]getArchiveTimestampData(String canonicalizationMethod)Returns concatenated data for an ArchiveTimestampprotected ArchiveTimestampTypegetArchiveTimestampType(XAdESAttribute unsignedAttribute)ReturnsArchiveTimestampTypefor the givenunsignedAttributeprotected List<Digest>getCertificateRefDigests(XAdESAttribute unsignedAttribute)Returns a list ofDigests from the givenunsignedAttributeprotected List<EncapsulatedCertificateTokenIdentifier>getEncapsulatedCertificateIdentifiers(XAdESAttribute unsignedAttribute)Returns a list ofEncapsulatedCertificateTokenIdentifiers obtained from the givenunsignedAttributeprotected List<CRLBinary>getEncapsulatedCRLIdentifiers(XAdESAttribute unsignedAttribute)Returns a list ofCRLBinarys obtained from the givenunsignedAttributeprotected List<OCSPResponseBinary>getEncapsulatedOCSPIdentifiers(XAdESAttribute unsignedAttribute)Returns a list ofOCSPResponseBinarys 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<Digest>getRevocationRefCRLDigests(XAdESAttribute unsignedAttribute)Returns a list of CRL revocation refDigests from the givenunsignedAttributeprotected List<Digest>getRevocationRefOCSPDigests(XAdESAttribute unsignedAttribute)Returns a list of OCSP revocation refDigests from the givenunsignedAttributebyte[]getSignatureTimestampData(String canonicalizationMethod)Returns concatenated data for a SignatureTimestampprotected List<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 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 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 providedsignatureAttribute-
Methods inherited from class eu.europa.esig.dss.validation.timestamp.AbstractTimestampSource
addEncapsulatedValuesFromTimestamp, addExternalTimestamp, addReference, addReferences, addReferencesForPreviousTimestamps, createAndValidate, createReferencesForCertificates, getAllContentTimestampReferences, getAllTimestamps, getArchiveTimestamps, getCertificateMapWithinTimestamps, getCertificates, getCommonCRLSource, getCommonOCSPSource, getContentTimestamps, getDocumentTimestamps, getSignatureSignedDataReferences, getSignatureTimestamps, getSignedDataReferences, getSigningCertificateTimestampReferences, getTimestampedCertificateRefs, getTimestampedCertificateValues, getTimestampedRevocationRefs, getTimestampedRevocationValues, getTimestampsX1, getTimestampsX2, getTimestampValidationData, makeTimestampTokens, populateTimestampCertificateSource, populateTimestampCertificateSource, validateTimestamps
-
-
-
-
Constructor Detail
-
XAdESTimestampSource
public XAdESTimestampSource(XAdESSignature signature, Element signatureElement, XPathQueryHolder xPathQueryHolder, CertificatePool certificatePool)
-
-
Method Detail
-
getSignedSignatureProperties
protected SignatureProperties<XAdESAttribute> getSignedSignatureProperties()
Description copied from class:AbstractTimestampSourceReturns the 'signed-signature-properties' element of the signature- Specified by:
getSignedSignaturePropertiesin classAbstractTimestampSource<XAdESAttribute>- Returns:
SignatureProperties
-
getUnsignedSignatureProperties
protected SignatureProperties<XAdESAttribute> getUnsignedSignatureProperties()
Description copied from class:AbstractTimestampSourceReturns the 'unsigned-signature-properties' element of the signature- Specified by:
getUnsignedSignaturePropertiesin classAbstractTimestampSource<XAdESAttribute>- Returns:
SignatureProperties
-
getTimestampDataBuilder
protected XAdESTimestampDataBuilder getTimestampDataBuilder()
Description copied from class:AbstractTimestampSourceReturns a relatedTimestampDataBuilder- Specified by:
getTimestampDataBuilderin classAbstractTimestampSource<XAdESAttribute>- Returns:
TimestampDataBuilder
-
getSignatureTimestampData
public byte[] getSignatureTimestampData(String canonicalizationMethod)
Returns concatenated data for a SignatureTimestamp- Parameters:
canonicalizationMethod-Stringcanonicalization method to use- Returns:
- byte array
-
getTimestampX1Data
public byte[] getTimestampX1Data(String canonicalizationMethod)
Returns concatenated data for a SigAndRefsTimestamp- Parameters:
canonicalizationMethod-Stringcanonicalization method to use- Returns:
- byte array
-
getTimestampX2Data
public byte[] getTimestampX2Data(String canonicalizationMethod)
Returns concatenated data for a RefsOnlyTimestamp- Parameters:
canonicalizationMethod-Stringcanonicalization method to use- Returns:
- byte array
-
getArchiveTimestampData
public byte[] getArchiveTimestampData(String canonicalizationMethod)
Returns concatenated data for an ArchiveTimestamp- Parameters:
canonicalizationMethod-Stringcanonicalization method to use- Returns:
- byte array
-
isContentTimestamp
protected boolean isContentTimestamp(XAdESAttribute signedAttribute)
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
protected boolean isAllDataObjectsTimestamp(XAdESAttribute 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<XAdESAttribute>- Parameters:
signedAttribute-ISignatureAttributeto process- Returns:
- TRUE if the
unsignedAttributeis a Data Objects Timestamp, FALSE otherwise
-
isIndividualDataObjectsTimestamp
protected boolean isIndividualDataObjectsTimestamp(XAdESAttribute 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<XAdESAttribute>- Parameters:
signedAttribute-ISignatureAttributeto process- Returns:
- TRUE if the
unsignedAttributeis a Data Objects Timestamp, FALSE otherwise
-
isSignatureTimestamp
protected boolean isSignatureTimestamp(XAdESAttribute unsignedAttribute)
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
protected boolean isCompleteCertificateRef(XAdESAttribute unsignedAttribute)
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
protected boolean isAttributeCertificateRef(XAdESAttribute unsignedAttribute)
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
protected boolean isCompleteRevocationRef(XAdESAttribute unsignedAttribute)
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
protected boolean isAttributeRevocationRef(XAdESAttribute unsignedAttribute)
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
protected boolean isRefsOnlyTimestamp(XAdESAttribute unsignedAttribute)
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
protected boolean isSigAndRefsTimestamp(XAdESAttribute unsignedAttribute)
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
protected boolean isCertificateValues(XAdESAttribute unsignedAttribute)
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
protected boolean isRevocationValues(XAdESAttribute unsignedAttribute)
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
-
isArchiveTimestamp
protected boolean isArchiveTimestamp(XAdESAttribute unsignedAttribute)
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
protected boolean isTimeStampValidationData(XAdESAttribute unsignedAttribute)
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
-
getSignatureTimestampReferences
protected List<TimestampedReference> getSignatureTimestampReferences()
Description copied from class:AbstractTimestampSourceReturns a list ofTimestampedReferencefor a "signature-timestamp" element- Overrides:
getSignatureTimestampReferencesin classAbstractTimestampSource<XAdESAttribute>- Returns:
- list of
TimestampedReferences
-
getCertificateRefDigests
protected List<Digest> getCertificateRefDigests(XAdESAttribute unsignedAttribute)
Description copied from class:AbstractTimestampSourceReturns a list ofDigests from the givenunsignedAttribute- Specified by:
getCertificateRefDigestsin classAbstractTimestampSource<XAdESAttribute>- Parameters:
unsignedAttribute-AbstractTimestampSourceto get certRef Digests from- Returns:
- list of
Digests
-
getRevocationRefCRLDigests
protected List<Digest> getRevocationRefCRLDigests(XAdESAttribute unsignedAttribute)
Description copied from class:AbstractTimestampSourceReturns a list of CRL revocation refDigests from the givenunsignedAttribute- Specified by:
getRevocationRefCRLDigestsin classAbstractTimestampSource<XAdESAttribute>- Parameters:
unsignedAttribute-AbstractTimestampSourceto get CRLRef Digests from- Returns:
- list of
Digests
-
getRevocationRefOCSPDigests
protected List<Digest> getRevocationRefOCSPDigests(XAdESAttribute unsignedAttribute)
Description copied from class:AbstractTimestampSourceReturns a list of OCSP revocation refDigests from the givenunsignedAttribute- Specified by:
getRevocationRefOCSPDigestsin classAbstractTimestampSource<XAdESAttribute>- Parameters:
unsignedAttribute-AbstractTimestampSourceto get OCSPRef Digests from- Returns:
- list of
Digests
-
getEncapsulatedCertificateIdentifiers
protected List<EncapsulatedCertificateTokenIdentifier> getEncapsulatedCertificateIdentifiers(XAdESAttribute unsignedAttribute)
Description copied from class:AbstractTimestampSourceReturns a list ofEncapsulatedCertificateTokenIdentifiers obtained from the givenunsignedAttribute- Specified by:
getEncapsulatedCertificateIdentifiersin classAbstractTimestampSource<XAdESAttribute>- Parameters:
unsignedAttribute-AbstractTimestampSourceto get certificate identifiers from- Returns:
- list of
EncapsulatedCertificateTokenIdentifiers
-
getEncapsulatedCRLIdentifiers
protected List<CRLBinary> getEncapsulatedCRLIdentifiers(XAdESAttribute unsignedAttribute)
Description copied from class:AbstractTimestampSourceReturns a list ofCRLBinarys obtained from the givenunsignedAttribute- Specified by:
getEncapsulatedCRLIdentifiersin classAbstractTimestampSource<XAdESAttribute>- Parameters:
unsignedAttribute-AbstractTimestampSourceto get CRL identifiers from- Returns:
- list of
CRLBinarys
-
getEncapsulatedOCSPIdentifiers
protected List<OCSPResponseBinary> getEncapsulatedOCSPIdentifiers(XAdESAttribute unsignedAttribute)
Description copied from class:AbstractTimestampSourceReturns a list ofOCSPResponseBinarys obtained from the givenunsignedAttribute- Specified by:
getEncapsulatedOCSPIdentifiersin classAbstractTimestampSource<XAdESAttribute>- Parameters:
unsignedAttribute-AbstractTimestampSourceto get OCSP identifiers from- Returns:
- list of
OCSPResponseBinarys
-
getArchiveTimestampType
protected ArchiveTimestampType getArchiveTimestampType(XAdESAttribute unsignedAttribute)
Description copied from class:AbstractTimestampSourceReturnsArchiveTimestampTypefor the givenunsignedAttribute- Specified by:
getArchiveTimestampTypein classAbstractTimestampSource<XAdESAttribute>- Parameters:
unsignedAttribute-AbstractTimestampSourceto get archive timestamp type for
-
-