Class PAdESSignature
java.lang.Object
eu.europa.esig.dss.validation.DefaultAdvancedSignature
eu.europa.esig.dss.cades.validation.CAdESSignature
eu.europa.esig.dss.pades.validation.PAdESSignature
- All Implemented Interfaces:
IdentifierBasedObject
,AdvancedSignature
,Serializable
Implementation of AdvancedSignature for PAdES
- See Also:
-
Field Summary
Fields inherited from class eu.europa.esig.dss.validation.DefaultAdvancedSignature
counterSignatures, detachedContents, manifestFile, offlineCertificateSource, offlineCertificateVerifier, referenceValidations, signatureCRLSource, signatureCryptographicVerification, signatureIdentifier, signatureOCSPSource, signaturePolicy, signatureTimestampSource, signingCertificateSource, structureValidationMessages
-
Constructor Summary
ModifierConstructorDescriptionprotected
PAdESSignature
(PdfSignatureRevision pdfSignatureRevision, List<PdfRevision> documentRevisions) The default constructor for PAdESSignature. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addExternalTimestamp
(TimestampToken timestamp) This method allows to add an external timestamp.protected PAdESBaselineRequirementsChecker
Instantiates aBaselineRequirementsChecker
according to the signature formatprotected PAdESBaselineRequirementsChecker
Returns a cached instance of theBaselineRequirementsChecker
Gets a certificate source which contains ALL certificates embedded in the signature.Gets a ListCertificateSource representing a merged source fromsignatureCertificateSource
and all included to the signature timestamp objectsGets a ListRevocationSource representing a merged source fromsignatureCRLSourse
and all included to the signature timestamp objectsGets a ListRevocationSource representing a merged source fromsignatureOCSPSourse
and all included to the signature timestamp objectsGets Content HintsGets ContentIdentifier StringReturns a list of counter signatures applied to this signatureGets a CRL source which contains ALL CRLs embedded in the signature.This method returns the signature levelReturns a list of timestamps defined with the 'DocTimeStamp' type NOTE: applicable only for PAdESGets the last DSS dictionary for the signatureGets an OCSP source which contains ALL OCSP responses embedded in the signature.Returns the original signed documentRetrieves a PdfRevision (PAdES) related to the current signatureGets thePdfSignatureDictionary
getSignatureDigestReference
(DigestAlgorithm digestAlgorithm) TS 119 442 - V1.1.1 - Electronic Signatures and Infrastructures (ESI), ch.Specifies the format of the signatureprotected SignatureIdentifierBuilder
Returns a builder to define and build a signature Idprotected DSSDocument
This method extracts a document content that was signed NOTE: Some differences are possible with PAdESReturns the signing time included within the signature.Gets a Signature Timestamp source which contains ALL timestamps embedded in the signature.Returns a VRI creation time defined within 'TU' field of a corresponding /VRI dictionaryName of the related to the signature VRI dictionaryReturns a list of timestamps enveloped within /VRI dictionary for the current signatureboolean
Checks the presence of ArchiveTimeStamp element in the signature, what is the proof -A profile existenceboolean
Checks the presence of an archive-time-stampboolean
Checks the presence of a validation databoolean
Checks the presence of PKCS#7 corresponding SubFilterboolean
Checks the presence of a signature-time-stampvoid
setDssCertificateSource
(ListCertificateSource dssCertificateSource) Sets a joint DSS/VRI Certificate Sourcevoid
setDssCRLSource
(ListRevocationSource<CRL> dssCRLSource) Sets a joint DSS/VRI CRL Sourcevoid
setDssOCSPSource
(ListRevocationSource<OCSP> dssOCSPSource) Sets a joint DSS/VRI OCSP SourceMethods inherited from class eu.europa.esig.dss.cades.validation.CAdESSignature
buildSignaturePolicy, checkSignatureIntegrity, getCertifiedSignerRoles, getClaimedSignerRoles, getCmsSignedData, getCommitmentTypeIndications, getContentType, getCounterSignatureStore, getDAIdentifier, getDataToBeSignedRepresentation, getDigestAlgorithm, getEncryptionAlgorithm, getMaskGenerationFunction, getMessageDigestAlgorithms, getMessageDigestValue, getMimeType, getReferenceValidations, getReferenceValidations, getSignatureAlgorithm, getSignaturePolicyStore, getSignatureProductionPlace, getSignatureValue, getSignedAssertions, getSignerId, getSignerInformation, getSignerInformationStoreInfos, hasBESProfile, hasCProfile, hasEPESProfile, hasExtendedTProfile, hasXLProfile, hasXProfile, isCounterSignature
Methods inherited from class eu.europa.esig.dss.validation.DefaultAdvancedSignature
areAllSelfSignedCertificates, equals, findSignatureScope, getAllTimestamps, getArchiveTimestamps, getCandidatesForSigningCertificate, getCertificates, getContainerContents, getContentTimestamps, getCounterSignaturesCertificateSource, getCounterSignaturesCRLSource, getCounterSignaturesOCSPSource, getDetachedContents, getDetachedTimestamps, getDSSId, getId, getManifestFile, getMasterSignature, getSignatureCryptographicVerification, getSignatureFilename, getSignaturePolicy, getSignatureScopes, getSignatureTimestamps, getSignerRoles, getSigningCertificateToken, getStructureValidationResult, getTimestampsX1, getTimestampsX2, hasBProfile, hashCode, hasLTAProfile, hasLTProfile, hasTProfile, isDocHashOnlyValidation, isHashOnlyValidation, prepareOfflineCertificateVerifier, resetCertificateSource, resetRevocationSources, resetTimestampSource, setContainerContents, setDetachedContents, setManifestFile, setMasterSignature, setSignatureFilename, setSigningCertificateSource, toString, validateStructure
-
Constructor Details
-
PAdESSignature
protected PAdESSignature(PdfSignatureRevision pdfSignatureRevision, List<PdfRevision> documentRevisions) The default constructor for PAdESSignature.- Parameters:
pdfSignatureRevision
- a relatedPdfSignatureRevision
documentRevisions
- a list ofPdfRevision
extracted from the validating document
-
-
Method Details
-
setDssCertificateSource
Sets a joint DSS/VRI Certificate Source- Parameters:
dssCertificateSource
-ListCertificateSource
-
setDssCRLSource
Sets a joint DSS/VRI CRL Source- Parameters:
dssCRLSource
-ListRevocationSource
-
setDssOCSPSource
Sets a joint DSS/VRI OCSP Source- Parameters:
dssOCSPSource
-ListRevocationSource
-
getSignatureForm
Description copied from interface:AdvancedSignature
Specifies the format of the signature- Specified by:
getSignatureForm
in interfaceAdvancedSignature
- Overrides:
getSignatureForm
in classCAdESSignature
- Returns:
SignatureForm
-
getCertificateSource
Description copied from interface:AdvancedSignature
Gets a certificate source which contains ALL certificates embedded in the signature.- Specified by:
getCertificateSource
in interfaceAdvancedSignature
- Overrides:
getCertificateSource
in classCAdESSignature
- Returns:
SignatureCertificateSource
-
getCRLSource
Description copied from interface:AdvancedSignature
Gets a CRL source which contains ALL CRLs embedded in the signature.- Specified by:
getCRLSource
in interfaceAdvancedSignature
- Overrides:
getCRLSource
in classCAdESSignature
- Returns:
OfflineRevocationSource
-
getOCSPSource
Description copied from interface:AdvancedSignature
Gets an OCSP source which contains ALL OCSP responses embedded in the signature.- Specified by:
getOCSPSource
in interfaceAdvancedSignature
- Overrides:
getOCSPSource
in classCAdESSignature
- Returns:
OfflineRevocationSource
-
getCompleteCertificateSource
Description copied from interface:AdvancedSignature
Gets a ListCertificateSource representing a merged source fromsignatureCertificateSource
and all included to the signature timestamp objects- Specified by:
getCompleteCertificateSource
in interfaceAdvancedSignature
- Overrides:
getCompleteCertificateSource
in classDefaultAdvancedSignature
- Returns:
ListCertificateSource
-
getCompleteCRLSource
Description copied from interface:AdvancedSignature
Gets a ListRevocationSource representing a merged source fromsignatureCRLSourse
and all included to the signature timestamp objects- Specified by:
getCompleteCRLSource
in interfaceAdvancedSignature
- Overrides:
getCompleteCRLSource
in classDefaultAdvancedSignature
- Returns:
ListRevocationSource
-
getCompleteOCSPSource
Description copied from interface:AdvancedSignature
Gets a ListRevocationSource representing a merged source fromsignatureOCSPSourse
and all included to the signature timestamp objects- Specified by:
getCompleteOCSPSource
in interfaceAdvancedSignature
- Overrides:
getCompleteOCSPSource
in classDefaultAdvancedSignature
- Returns:
ListRevocationSource
-
getTimestampSource
Description copied from interface:AdvancedSignature
Gets a Signature Timestamp source which contains ALL timestamps embedded in the signature.- Specified by:
getTimestampSource
in interfaceAdvancedSignature
- Overrides:
getTimestampSource
in classCAdESSignature
- Returns:
SignatureTimestampSource
-
getDocumentTimestamps
Description copied from interface:AdvancedSignature
Returns a list of timestamps defined with the 'DocTimeStamp' type NOTE: applicable only for PAdES- Specified by:
getDocumentTimestamps
in interfaceAdvancedSignature
- Overrides:
getDocumentTimestamps
in classDefaultAdvancedSignature
- Returns:
List
ofTimestampToken
s
-
getVRITimestamps
Returns a list of timestamps enveloped within /VRI dictionary for the current signature- Returns:
- a list of
TimestampToken
s
-
getSigningTime
Description copied from interface:AdvancedSignature
Returns the signing time included within the signature.- Specified by:
getSigningTime
in interfaceAdvancedSignature
- Overrides:
getSigningTime
in classCAdESSignature
- Returns:
Date
representing the signing time or null
-
getContentIdentifier
Description copied from class:CAdESSignature
Gets ContentIdentifier String- Overrides:
getContentIdentifier
in classCAdESSignature
- Returns:
- content identifier as
String
-
getContentHints
Description copied from class:CAdESSignature
Gets Content Hints- Overrides:
getContentHints
in classCAdESSignature
- Returns:
- content hints as
String
-
getCounterSignatures
Description copied from interface:AdvancedSignature
Returns a list of counter signatures applied to this signature- Specified by:
getCounterSignatures
in interfaceAdvancedSignature
- Overrides:
getCounterSignatures
in classCAdESSignature
- Returns:
- a
List
ofAdvancedSignatures
representing the counter signatures
-
getOriginalDocument
Description copied from class:CAdESSignature
Returns the original signed document- Overrides:
getOriginalDocument
in classCAdESSignature
- Returns:
DSSDocument
-
getSignerDocumentContent
Description copied from class:CAdESSignature
This method extracts a document content that was signed NOTE: Some differences are possible with PAdES- Overrides:
getSignerDocumentContent
in classCAdESSignature
- Returns:
DSSDocument
-
getSignatureIdentifierBuilder
Description copied from class:DefaultAdvancedSignature
Returns a builder to define and build a signature Id- Overrides:
getSignatureIdentifierBuilder
in classCAdESSignature
- Returns:
SignatureIdentifierBuilder
-
getSignatureDigestReference
TS 119 442 - V1.1.1 - Electronic Signatures and Infrastructures (ESI), ch. 5.1.4.2.1.3 XML component: In case of PAdES signatures, the input of the digest value computation shall be the result of decoding the hexadecimal string present within the Contents field of the Signature PDF dictionary enclosing one PAdES digital signature.- Specified by:
getSignatureDigestReference
in interfaceAdvancedSignature
- Overrides:
getSignatureDigestReference
in classCAdESSignature
- Parameters:
digestAlgorithm
-DigestAlgorithm
to use- Returns:
SignatureDigestReference
-
getDataFoundUpToLevel
Description copied from interface:AdvancedSignature
This method returns the signature level- Specified by:
getDataFoundUpToLevel
in interfaceAdvancedSignature
- Overrides:
getDataFoundUpToLevel
in classCAdESSignature
- Returns:
- a value of
SignatureLevel
-
getBaselineRequirementsChecker
Description copied from class:DefaultAdvancedSignature
Returns a cached instance of theBaselineRequirementsChecker
- Overrides:
getBaselineRequirementsChecker
in classCAdESSignature
- Returns:
BaselineRequirementsChecker
-
createBaselineRequirementsChecker
Description copied from class:DefaultAdvancedSignature
Instantiates aBaselineRequirementsChecker
according to the signature format- Overrides:
createBaselineRequirementsChecker
in classCAdESSignature
- Returns:
BaselineRequirementsChecker
-
hasPKCS7Profile
public boolean hasPKCS7Profile()Checks the presence of PKCS#7 corresponding SubFilter- Returns:
- true if PKCS#7 Profile is detected
-
hasPKCS7TProfile
public boolean hasPKCS7TProfile()Checks the presence of a signature-time-stamp- Returns:
- true if PKCS#7-T Profile is detected
-
hasPKCS7LTProfile
public boolean hasPKCS7LTProfile()Checks the presence of a validation data- Returns:
- true if PKCS#7-LT Profile is detected
-
hasPKCS7LTAProfile
public boolean hasPKCS7LTAProfile()Checks the presence of an archive-time-stamp- Returns:
- true if PKCS#7-LTA Profile is detected
-
hasAProfile
public boolean hasAProfile()Checks the presence of ArchiveTimeStamp element in the signature, what is the proof -A profile existence- Overrides:
hasAProfile
in classCAdESSignature
- Returns:
- true if the -A extension is present
-
getDssDictionary
Gets the last DSS dictionary for the signature- Returns:
PdfDssDict
-
getPdfRevision
Retrieves a PdfRevision (PAdES) related to the current signature- Returns:
PdfRevision
-
getPdfSignatureDictionary
Gets thePdfSignatureDictionary
- Returns:
PdfSignatureDictionary
-
getVRIKey
Name of the related to the signature VRI dictionary- Returns:
- related
String
VRI dictionary name
-
getVRICreationTime
Returns a VRI creation time defined within 'TU' field of a corresponding /VRI dictionary- Returns:
Date
of VRI dictionary creation, when present
-
addExternalTimestamp
Description copied from interface:AdvancedSignature
This method allows to add an external timestamp. The given timestamp must be processed before. NOTE: The method is supported only for CAdES signatures- Specified by:
addExternalTimestamp
in interfaceAdvancedSignature
- Overrides:
addExternalTimestamp
in classCAdESSignature
- Parameters:
timestamp
- the timestamp token
-