Package eu.europa.esig.dss.validation
Class DefaultAdvancedSignature
- java.lang.Object
-
- eu.europa.esig.dss.validation.DefaultAdvancedSignature
-
- All Implemented Interfaces:
AdvancedSignature,Serializable
- Direct Known Subclasses:
CAdESSignature,XAdESSignature
public abstract class DefaultAdvancedSignature extends Object implements AdvancedSignature
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDefaultAdvancedSignature.RevocationDataForInclusion
-
Field Summary
Fields Modifier and Type Field Description protected CandidatesForSigningCertificatecandidatesForSigningCertificateThe reference to the object containing all candidates to the signing certificate.protected CertificatePoolcertPoolThis is the reference to the global (external) pool of certificates.protected List<DSSDocument>detachedContentsIn case of a detached signature this is the signed document.protected List<ManifestFile>manifestFilesIn case of a ASiC-E signature this is the list of found manifest files.protected SignatureCertificateSourceofflineCertificateSourceprotected CertificateTokenprovidedSigningCertificateTokenIn the case of a non AdES signature the signing certificate is not mandatory within the signature and can be provided by the driving application.protected List<ReferenceValidation>referenceValidationsThis variable contains a list of reference validations (reference tag for XAdES or message-digest for CAdES)protected SignatureCRLSourcesignatureCRLSourceprotected SignatureCryptographicVerificationsignatureCryptographicVerificationThis variable contains the result of the signature mathematical validation.protected SignatureIdentifiersignatureIdentifierprotected SignatureOCSPSourcesignatureOCSPSourceprotected SignaturePolicysignaturePolicyprotected SignatureTimestampSourcesignatureTimestampSourceprotected StringstructureValidation
-
Constructor Summary
Constructors Modifier Constructor Description protectedDefaultAdvancedSignature(CertificatePool certPool)
-
Method Summary
Modifier and Type Method Description protected voidaddEncapsulatedCertificatesFromTimestamp(List<TimestampedReference> references, TimestampToken timestampedTimestamp)voidaddExternalTimestamp(TimestampToken timestamp)This method allows to add an external timestamp.protected voidaddReference(List<TimestampedReference> referenceList, TimestampedReference referenceToAdd)AddsreferenceToAddtoreferenceListwithout duplicatesprotected voidaddReferences(List<TimestampedReference> referenceList, List<TimestampedReference> referencesToAdd)AddsreferencesToAddtoreferenceListwithout duplicatesprotected voidaddReferencesForCertificates(List<TimestampedReference> references)protected voidaddReferencesForPreviousTimestamps(List<TimestampedReference> references, List<TimestampToken> timestampedTimestamps)protected voidaddReferencesFromRevocationData(List<TimestampedReference> references)This method adds references to retrieved revocation data.protected abstract SignatureIdentifierbuildSignatureIdentifier()Build and definessignatureIdentifiervaluebooleanequals(Object obj)List<RevocationRef>findRefsForRevocationIdentifier(EncapsulatedRevocationTokenIdentifier revocationIdentifier)Retrieves a list of foundRevocationRefs for the givenrevocationIdentifierList<RevocationRef>findRefsForRevocationToken(RevocationToken revocationToken)Retrieves a list of foundRevocationRefs for the givenrevocationTokenvoidfindSignatureScope(SignatureScopeFinder signatureScopeFinder)List<EncapsulatedRevocationTokenIdentifier>getAllFoundRevocationIdentifiers()Returns a list of allEncapsulatedRevocationTokenIdentifiers found in CRL and OCSP sourcesList<RevocationRef>getAllFoundRevocationRefs()Retrieves a list of all foundRevocationRefs present in the signatureSet<RevocationToken>getAllRevocationTokens()Retrieves the set of allRevocationTokens in the signatureList<TimestampToken>getAllTimestamps()Returns a list of all timestamps found in the signatureList<TimestampToken>getArchiveTimestamps()Returns the archive TimestampsList<CRLRef>getAttributeRevocationCRLReferences()Retrieves a list of allCRLRefs present in 'AttributeRevocationRefs' element NOTE: Applicable only for XAdES and CAdES revocation sourcesList<OCSPRef>getAttributeRevocationOCSPReferences()Retrieves a list of allOCSPRefs present in 'AttributeRevocationRefs' element NOTE: Applicable only for XAdES and CAdES revocation sourcesList<RevocationToken>getAttributeRevocationTokens()Retrieves the list of allRevocationTokens present in 'AttributeRevocationRefs' element NOTE: Applicable only for XAdES and CAdES revocation sourcesList<RevocationToken>getAttributeRevocationValuesTokens()Retrieves the list of allRevocationTokens present in 'AttributeRevocationValues' element NOTE: Applicable only for XAdES revocation sourceList<CertificateToken>getCertificateListWithinSignatureAndTimestamps()Returns a list of all certificates found into signature and timestampsMap<String,List<CertificateToken>>getCertificateMapWithinSignatureAndTimestamps(boolean skipLastArchiveTimestamp)Returns a map between found certificate chains in signature and timestampsList<CertificateToken>getCertificates()Returns an unmodifiable list of all certificate tokens encapsulated in the signatureSet<CertificateToken>getCertificatesForInclusion(ValidationContext validationContext)This method returns all certificates used during the validation process.ListCRLSourcegetCompleteCRLSource()Gets a ListCRLSource representing a merged source fromsignatureCRLSourseand all included to the signature timestamp objectsListOCSPSourcegetCompleteOCSPSource()Gets a ListOCSPSource representing a merged source fromsignatureOCSPSourseand all included to the signature timestamp objectsList<CRLRef>getCompleteRevocationCRLReferences()Retrieves a list of allCRLRefs present in 'CompleteRevocationRefs' element NOTE: Applicable only for XAdES and CAdES revocation sourcesList<OCSPRef>getCompleteRevocationOCSPReferences()Retrieves a list of allOCSPRefs present in 'CompleteRevocationRefs' element NOTE: Applicable only for XAdES and CAdES revocation sourcesList<RevocationToken>getCompleteRevocationTokens()Retrieves the list of allRevocationTokens present in 'CompleteRevocationRefs' element NOTE: Applicable only for XAdES and CAdES revocation sourcesStringgetContactInfo()List<DSSDocument>getContainerContents()protected List<TimestampedReference>getContentTimestampReferences()List<TimestampToken>getContentTimestamps()Returns the content timestampsSignatureLevelgetDataFoundUpToLevel()List<DSSDocument>getDetachedContents()List<TimestampToken>getDocumentTimestamps()Returns a list of timestamps defined with the 'DocTimeStamp' type NOTE: applicable only for PAdESList<RevocationToken>getDSSDictionaryRevocationTokens()Retrieves the list of allRevocationTokens present in 'DSS' dictionary NOTE: Applicable only for PAdES revocation sourceSignatureIdentifiergetDSSId()This method returns theSignatureIdentifier.StringgetFilter()StringgetId()This method returns the DSS unique signature id.List<DSSDocument>getManifestedDocuments()AdvancedSignaturegetMasterSignature()byte[]getMessageDigestValue()List<CertificateRef>getOrphanCertificateRefs()Returns a list of orphan certificate refs, that are not associated to anyCertificateTokenList<RevocationRef>getOrphanRevocationRefs()Returns a list of all orphanRevocationRefs found into the signatureSignaturePolicygetPolicyId()Returns the Signature Policy OID from the signature.CertificateTokengetProvidedSigningCertificateToken()StringgetReason()DefaultAdvancedSignature.RevocationDataForInclusiongetRevocationDataForInclusion(ValidationContext validationContext)This method returns revocation values (ocsp and crl) that will be included in the LT profile.List<RevocationToken>getRevocationValuesTokens()Retrieves the list of allRevocationTokens present in 'RevocationValues' element NOTE: Applicable only for CAdES and XAdES revocation sourcesint[]getSignatureByteRange()SignatureCryptographicVerificationgetSignatureCryptographicVerification()StringgetSignatureFieldName()StringgetSignatureFilename()This method returns the signature filename (useful for ASiC and multiple signature files)List<SignatureScope>getSignatureScopes()protected List<TimestampedReference>getSignatureTimestampReferences()List<TimestampToken>getSignatureTimestamps()Returns the signature timestampsValidationContextgetSignatureValidationContext(CertificateVerifier certificateVerifier)This method validates the signing certificate and all timestamps.StringgetSignerName()List<SignerRole>getSignerRoles()Returns the list of roles of the signer.protected List<TimestampedReference>getSigningCertificateTimestampReferences()CertificateTokengetSigningCertificateToken()This method returns the signing certificate token or null if there is no valid signing certificate.StringgetStructureValidationResult()StringgetSubFilter()protected List<TimestampedReference>getTimestampedReferencesFromCertificates(List<CertificateToken> certificateTokens)Creates a list ofTimestampedReferences for the providedcertificateTokensList<CRLRef>getTimestampRevocationCRLReferences()Retrieves a list of allCRLRefs present in a timestamp element NOTE: Applicable only for CAdES revocation sourceList<OCSPRef>getTimestampRevocationOCSPReferences()Retrieves a list of allOCSPRefs present in a timestamp element NOTE: Applicable only for CAdES revocation sourceList<CertificateToken>getTimestampSourceCertificates()Returns a list ofCertificateTokens found in theSignatureTimestampSourceList<TimestampToken>getTimestampsX1()Returns the time-stamp which is placed on the digital signature (XAdES example: ds:SignatureValue element), the signature time-stamp(s) present in the AdES-T form, the certification path references and the revocation status references.List<TimestampToken>getTimestampsX2()Returns the time-stamp which is computed over the concatenation of CompleteCertificateRefs and CompleteRevocationRefs elements (XAdES example).List<RevocationToken>getTimestampValidationDataTokens()Retrieves the list of allRevocationTokens present in 'TimestampValidationData/RevocationValues' element NOTE: Applicable only for XAdES revocation sourceList<RevocationToken>getVRIDictionaryRevocationTokens()Retrieves the list of allRevocationTokens present in 'VRI' dictionary NOTE: Applicable only for PAdES revocation sourceinthashCode()booleanhasLTAProfile()booleanhasLTProfile()booleanhasTProfile()booleanisDocHashOnlyValidation()Returns true if the validation of the signature has been performed only on Signer's Document Representation (SDR).booleanisHashOnlyValidation()Returns true if the validation of the signature has been performed only on Data To Be Signed Representation (DTBSR).voidpopulateCRLTokenLists(SignatureCRLSource crlSource)Fills all the missingCRLTokens from the givensignatureCRLSourcevoidpopulateOCSPTokenLists(SignatureOCSPSource ocspSource)Fills all the missingOCSPTokens from the givensignatureOCSPSourcevoidprepareTimestamps(ValidationContext validationContext)This method adds to theValidationContextall timestamps to be validated.voidsetContainerContents(List<DSSDocument> containerContents)This method allows to set the container contents in the case of ASiC signature.voidsetDetachedContents(List<DSSDocument> detachedContents)This method allows to set the signed contents in the case of the detached signature.voidsetManifestFiles(List<ManifestFile> manifestFiles)This method allows to set the manifest files in the case of ASiC-E signature.voidsetMasterSignature(AdvancedSignature masterSignature)This setter allows to indicate the master signature.voidsetProvidedSigningCertificateToken(CertificateToken certificateToken)This method allows to provide a signing certificate to be used in the validation process.voidsetSignatureFilename(String signatureFilename)This method allows to set the signature filename (useful in case of ASiC)voidvalidateStructure()This method allows the structure validation of the signature.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface eu.europa.esig.dss.validation.AdvancedSignature
checkSignatureIntegrity, checkSignaturePolicy, checkSigningCertificate, getCandidatesForSigningCertificate, getCertificateRefs, getCertificateSource, getCertifiedSignerRoles, getClaimedSignerRoles, getCommitmentTypeIndication, getContentHints, getContentIdentifier, getContentType, getCounterSignatures, getCRLSource, getDAIdentifier, getDigestAlgorithm, getEncryptionAlgorithm, getMaskGenerationFunction, getMimeType, getOCSPSource, getReferenceValidations, getSignatureAlgorithm, getSignatureDigestReference, getSignatureForm, getSignatureLevels, getSignatureProductionPlace, getSignatureValue, getSigningTime, getTimestampSource, isDataForSignatureLevelPresent
-
-
-
-
Field Detail
-
certPool
protected final CertificatePool certPool
This is the reference to the global (external) pool of certificates. All encapsulated certificates in the signature are added to this pool. SeeCertificatePool
-
providedSigningCertificateToken
protected CertificateToken providedSigningCertificateToken
In the case of a non AdES signature the signing certificate is not mandatory within the signature and can be provided by the driving application.
-
detachedContents
protected List<DSSDocument> detachedContents
In case of a detached signature this is the signed document.
-
manifestFiles
protected List<ManifestFile> manifestFiles
In case of a ASiC-E signature this is the list of found manifest files.
-
referenceValidations
protected List<ReferenceValidation> referenceValidations
This variable contains a list of reference validations (reference tag for XAdES or message-digest for CAdES)
-
signatureCryptographicVerification
protected SignatureCryptographicVerification signatureCryptographicVerification
This variable contains the result of the signature mathematical validation. It is initialised when the methodcheckSignatureIntegrityis called.
-
structureValidation
protected String structureValidation
-
candidatesForSigningCertificate
protected CandidatesForSigningCertificate candidatesForSigningCertificate
The reference to the object containing all candidates to the signing certificate.
-
offlineCertificateSource
protected SignatureCertificateSource offlineCertificateSource
-
signatureCRLSource
protected SignatureCRLSource signatureCRLSource
-
signatureOCSPSource
protected SignatureOCSPSource signatureOCSPSource
-
signatureTimestampSource
protected SignatureTimestampSource signatureTimestampSource
-
signaturePolicy
protected SignaturePolicy signaturePolicy
-
signatureIdentifier
protected SignatureIdentifier signatureIdentifier
-
-
Constructor Detail
-
DefaultAdvancedSignature
protected DefaultAdvancedSignature(CertificatePool certPool)
- Parameters:
certPool- can be null
-
-
Method Detail
-
buildSignatureIdentifier
protected abstract SignatureIdentifier buildSignatureIdentifier()
Build and definessignatureIdentifiervalue
-
getSignatureFilename
public String getSignatureFilename()
Description copied from interface:AdvancedSignatureThis method returns the signature filename (useful for ASiC and multiple signature files)- Specified by:
getSignatureFilenamein interfaceAdvancedSignature- Returns:
- the signature filename
-
setSignatureFilename
public void setSignatureFilename(String signatureFilename)
Description copied from interface:AdvancedSignatureThis method allows to set the signature filename (useful in case of ASiC)- Specified by:
setSignatureFilenamein interfaceAdvancedSignature
-
getDetachedContents
public List<DSSDocument> getDetachedContents()
- Specified by:
getDetachedContentsin interfaceAdvancedSignature- Returns:
- in the case of the detached signature this is the
Listof signed contents.
-
setDetachedContents
public void setDetachedContents(List<DSSDocument> detachedContents)
Description copied from interface:AdvancedSignatureThis method allows to set the signed contents in the case of the detached signature.- Specified by:
setDetachedContentsin interfaceAdvancedSignature- Parameters:
detachedContents-ListofDSSDocumentrepresenting the signed detached contents.
-
getContainerContents
public List<DSSDocument> getContainerContents()
- Specified by:
getContainerContentsin interfaceAdvancedSignature- Returns:
- in case of ASiC signature returns a list of container documents
-
setContainerContents
public void setContainerContents(List<DSSDocument> containerContents)
Description copied from interface:AdvancedSignatureThis method allows to set the container contents in the case of ASiC signature.- Specified by:
setContainerContentsin interfaceAdvancedSignature- Parameters:
containerContents-ListofDSSDocumentrepresenting the container contents.
-
setManifestFiles
public void setManifestFiles(List<ManifestFile> manifestFiles)
Description copied from interface:AdvancedSignatureThis method allows to set the manifest files in the case of ASiC-E signature.- Specified by:
setManifestFilesin interfaceAdvancedSignature- Parameters:
manifestFiles-ListofManifestFiles
-
getOrphanCertificateRefs
public List<CertificateRef> getOrphanCertificateRefs()
Description copied from interface:AdvancedSignatureReturns a list of orphan certificate refs, that are not associated to anyCertificateToken- Specified by:
getOrphanCertificateRefsin interfaceAdvancedSignature- Returns:
- list of found
CertificateRefs
-
getDSSId
public SignatureIdentifier getDSSId()
Description copied from interface:AdvancedSignatureThis method returns theSignatureIdentifier.- Specified by:
getDSSIdin interfaceAdvancedSignature- Returns:
- unique
SignatureIdentifier
-
getId
public String getId()
Description copied from interface:AdvancedSignatureThis method returns the DSS unique signature id. It allows to unambiguously identify each signature.- Specified by:
getIdin interfaceAdvancedSignature- Returns:
- The signature unique Id
-
getManifestedDocuments
public List<DSSDocument> getManifestedDocuments()
- Specified by:
getManifestedDocumentsin interfaceAdvancedSignature- Returns:
- in case of ASiC-E signature returns a list of
DSSDocuments contained in the related signature manifest
-
getDataFoundUpToLevel
public SignatureLevel getDataFoundUpToLevel()
- Specified by:
getDataFoundUpToLevelin interfaceAdvancedSignature- Returns:
- the upper level for which data have been found. Doesn't mean any validity of the data found. Null if unknown.
-
getCompleteCRLSource
public ListCRLSource getCompleteCRLSource()
Description copied from interface:AdvancedSignatureGets a ListCRLSource representing a merged source fromsignatureCRLSourseand all included to the signature timestamp objects- Specified by:
getCompleteCRLSourcein interfaceAdvancedSignature- Returns:
ListCRLSource
-
getCompleteOCSPSource
public ListOCSPSource getCompleteOCSPSource()
Description copied from interface:AdvancedSignatureGets a ListOCSPSource representing a merged source fromsignatureOCSPSourseand all included to the signature timestamp objects- Specified by:
getCompleteOCSPSourcein interfaceAdvancedSignature- Returns:
ListOCSPSource
-
getSignatureValidationContext
public ValidationContext getSignatureValidationContext(CertificateVerifier certificateVerifier)
This method validates the signing certificate and all timestamps.- Returns:
- signature validation context containing all certificates and revocation data used during the validation process.
-
getCertificates
public List<CertificateToken> getCertificates()
Returns an unmodifiable list of all certificate tokens encapsulated in the signature- Specified by:
getCertificatesin interfaceAdvancedSignature- Returns:
- a list of certificate contained within the signature
- See Also:
AdvancedSignature.getCertificates()
-
getTimestampSourceCertificates
public List<CertificateToken> getTimestampSourceCertificates()
Returns a list ofCertificateTokens found in theSignatureTimestampSource- Returns:
- list of
CertificateTokens
-
getCertificatesForInclusion
public Set<CertificateToken> getCertificatesForInclusion(ValidationContext validationContext)
This method returns all certificates used during the validation process. If a certificate is already present within the signature then it is ignored.- Parameters:
validationContext- validation context containing all information about the validation process of the signing certificate and time-stamps- Returns:
- set of certificates not yet present within the signature
-
getCertificateListWithinSignatureAndTimestamps
public List<CertificateToken> getCertificateListWithinSignatureAndTimestamps()
Description copied from interface:AdvancedSignatureReturns a list of all certificates found into signature and timestamps- Specified by:
getCertificateListWithinSignatureAndTimestampsin interfaceAdvancedSignature- Returns:
- list of
CertificateTokens
-
getCertificateMapWithinSignatureAndTimestamps
public Map<String,List<CertificateToken>> getCertificateMapWithinSignatureAndTimestamps(boolean skipLastArchiveTimestamp)
Returns a map between found certificate chains in signature and timestamps- Parameters:
skipLastArchiveTimestamp- - if chain for the last archive timestamp must not be included to the final map- Returns:
- map between signature/timestamp instances and their certificate chains
-
getRevocationDataForInclusion
public DefaultAdvancedSignature.RevocationDataForInclusion getRevocationDataForInclusion(ValidationContext validationContext)
This method returns revocation values (ocsp and crl) that will be included in the LT profile.- Parameters:
validationContext-ValidationContextcontains all the revocation data retrieved during the validation process.- Returns:
RevocationDataForInclusion
-
setMasterSignature
public void setMasterSignature(AdvancedSignature masterSignature)
Description copied from interface:AdvancedSignatureThis setter allows to indicate the master signature. It means that this is a countersignature.- Specified by:
setMasterSignaturein interfaceAdvancedSignature- Parameters:
masterSignature-AdvancedSignature
-
getMasterSignature
public AdvancedSignature getMasterSignature()
- Specified by:
getMasterSignaturein interfaceAdvancedSignature- Returns:
AdvancedSignature
-
getSignatureCryptographicVerification
public SignatureCryptographicVerification getSignatureCryptographicVerification()
- Specified by:
getSignatureCryptographicVerificationin interfaceAdvancedSignature- Returns:
- SignatureCryptographicVerification with all the information collected during the validation process.
-
getSignerRoles
public List<SignerRole> getSignerRoles()
Description copied from interface:AdvancedSignatureReturns the list of roles of the signer.- Specified by:
getSignerRolesin interfaceAdvancedSignature- Returns:
- list of the
SignerRoles
-
getProvidedSigningCertificateToken
public CertificateToken getProvidedSigningCertificateToken()
- Specified by:
getProvidedSigningCertificateTokenin interfaceAdvancedSignature- Returns:
- This method returns the provided signing certificate or
null
-
setProvidedSigningCertificateToken
public void setProvidedSigningCertificateToken(CertificateToken certificateToken)
Description copied from interface:AdvancedSignatureThis method allows to provide a signing certificate to be used in the validation process. It can happen in the case of a non-AdES signature without the signing certificate within the signature.- Specified by:
setProvidedSigningCertificateTokenin interfaceAdvancedSignature- Parameters:
certificateToken-CertificateTokenrepresenting the signing certificate token.
-
getSigningCertificateToken
public CertificateToken getSigningCertificateToken()
Description copied from interface:AdvancedSignatureThis method returns the signing certificate token or null if there is no valid signing certificate. Note that to determinate the signing certificate the signature must be validated: the methodcheckSignatureIntegritymust be called.- Specified by:
getSigningCertificateTokenin interfaceAdvancedSignature- Returns:
-
prepareTimestamps
public void prepareTimestamps(ValidationContext validationContext)
This method adds to theValidationContextall timestamps to be validated.- Specified by:
prepareTimestampsin interfaceAdvancedSignature- Parameters:
validationContext-ValidationContextto which the timestamps must be added
-
validateStructure
public void validateStructure()
Description copied from interface:AdvancedSignatureThis method allows the structure validation of the signature.- Specified by:
validateStructurein interfaceAdvancedSignature
-
getStructureValidationResult
public String getStructureValidationResult()
- Specified by:
getStructureValidationResultin interfaceAdvancedSignature
-
getContentTimestampReferences
protected List<TimestampedReference> getContentTimestampReferences()
-
getSignatureTimestampReferences
protected List<TimestampedReference> getSignatureTimestampReferences()
-
getSigningCertificateTimestampReferences
protected List<TimestampedReference> getSigningCertificateTimestampReferences()
-
addReferencesForPreviousTimestamps
protected void addReferencesForPreviousTimestamps(List<TimestampedReference> references, List<TimestampToken> timestampedTimestamps)
-
addEncapsulatedCertificatesFromTimestamp
protected void addEncapsulatedCertificatesFromTimestamp(List<TimestampedReference> references, TimestampToken timestampedTimestamp)
-
addReferencesForCertificates
protected void addReferencesForCertificates(List<TimestampedReference> references)
-
getTimestampedReferencesFromCertificates
protected List<TimestampedReference> getTimestampedReferencesFromCertificates(List<CertificateToken> certificateTokens)
Creates a list ofTimestampedReferences for the providedcertificateTokens- Parameters:
certificateTokens- list ofCertificateTokens to create timestamped references for- Returns:
- list of
TimestampedReferences
-
addReferencesFromRevocationData
protected void addReferencesFromRevocationData(List<TimestampedReference> references)
This method adds references to retrieved revocation data.- Parameters:
references-
-
addReference
protected void addReference(List<TimestampedReference> referenceList, TimestampedReference referenceToAdd)
AddsreferenceToAddtoreferenceListwithout duplicates- Parameters:
referenceList- - list ofTimestampedReferences to be extendedreferenceToAdd- -TimestampedReferenceto be added
-
addReferences
protected void addReferences(List<TimestampedReference> referenceList, List<TimestampedReference> referencesToAdd)
AddsreferencesToAddtoreferenceListwithout duplicates- Parameters:
referenceList- - list ofTimestampedReferences to be extendedreferencesToAdd- -TimestampedReferences to be added
-
getPolicyId
public SignaturePolicy getPolicyId()
Description copied from interface:AdvancedSignatureReturns the Signature Policy OID from the signature.- Specified by:
getPolicyIdin interfaceAdvancedSignature- Returns:
SignaturePolicy
-
populateCRLTokenLists
public void populateCRLTokenLists(SignatureCRLSource crlSource)
Description copied from interface:AdvancedSignatureFills all the missingCRLTokens from the givensignatureCRLSource- Specified by:
populateCRLTokenListsin interfaceAdvancedSignature
-
populateOCSPTokenLists
public void populateOCSPTokenLists(SignatureOCSPSource ocspSource)
Description copied from interface:AdvancedSignatureFills all the missingOCSPTokens from the givensignatureOCSPSource- Specified by:
populateOCSPTokenListsin interfaceAdvancedSignature
-
findSignatureScope
public void findSignatureScope(SignatureScopeFinder signatureScopeFinder)
- Specified by:
findSignatureScopein interfaceAdvancedSignature
-
getSignatureScopes
public List<SignatureScope> getSignatureScopes()
- Specified by:
getSignatureScopesin interfaceAdvancedSignature
-
getContentTimestamps
public List<TimestampToken> getContentTimestamps()
Description copied from interface:AdvancedSignatureReturns the content timestamps- Specified by:
getContentTimestampsin interfaceAdvancedSignature- Returns:
ListofTimestampToken
-
getSignatureTimestamps
public List<TimestampToken> getSignatureTimestamps()
Description copied from interface:AdvancedSignatureReturns the signature timestamps- Specified by:
getSignatureTimestampsin interfaceAdvancedSignature- Returns:
ListofTimestampToken
-
getTimestampsX1
public List<TimestampToken> getTimestampsX1()
Description copied from interface:AdvancedSignatureReturns the time-stamp which is placed on the digital signature (XAdES example: ds:SignatureValue element), the signature time-stamp(s) present in the AdES-T form, the certification path references and the revocation status references.- Specified by:
getTimestampsX1in interfaceAdvancedSignature- Returns:
ListofTimestampToken
-
getTimestampsX2
public List<TimestampToken> getTimestampsX2()
Description copied from interface:AdvancedSignatureReturns the time-stamp which is computed over the concatenation of CompleteCertificateRefs and CompleteRevocationRefs elements (XAdES example).- Specified by:
getTimestampsX2in interfaceAdvancedSignature- Returns:
ListofTimestampToken
-
getArchiveTimestamps
public List<TimestampToken> getArchiveTimestamps()
Description copied from interface:AdvancedSignatureReturns the archive Timestamps- Specified by:
getArchiveTimestampsin interfaceAdvancedSignature- Returns:
ListofTimestampTokens
-
getDocumentTimestamps
public List<TimestampToken> getDocumentTimestamps()
Description copied from interface:AdvancedSignatureReturns a list of timestamps defined with the 'DocTimeStamp' type NOTE: applicable only for PAdES- Specified by:
getDocumentTimestampsin interfaceAdvancedSignature- Returns:
ListofTimestampTokens
-
getAllTimestamps
public List<TimestampToken> getAllTimestamps()
Description copied from interface:AdvancedSignatureReturns a list of all timestamps found in the signature- Specified by:
getAllTimestampsin interfaceAdvancedSignature- Returns:
ListofTimestampTokens
-
addExternalTimestamp
public void addExternalTimestamp(TimestampToken timestamp)
Description copied from interface:AdvancedSignatureThis method allows to add an external timestamp. The given timestamp must be processed before.- Specified by:
addExternalTimestampin interfaceAdvancedSignature- Parameters:
timestamp- the timestamp token
-
hasTProfile
public boolean hasTProfile()
-
hasLTProfile
public boolean hasLTProfile()
-
hasLTAProfile
public boolean hasLTAProfile()
-
getAllRevocationTokens
public Set<RevocationToken> getAllRevocationTokens()
Description copied from interface:AdvancedSignatureRetrieves the set of allRevocationTokens in the signature- Specified by:
getAllRevocationTokensin interfaceAdvancedSignature- Returns:
- list of
RevocationTokens
-
getRevocationValuesTokens
public List<RevocationToken> getRevocationValuesTokens()
Description copied from interface:AdvancedSignatureRetrieves the list of allRevocationTokens present in 'RevocationValues' element NOTE: Applicable only for CAdES and XAdES revocation sources- Specified by:
getRevocationValuesTokensin interfaceAdvancedSignature- Returns:
- list of
RevocationTokens
-
getAttributeRevocationValuesTokens
public List<RevocationToken> getAttributeRevocationValuesTokens()
Description copied from interface:AdvancedSignatureRetrieves the list of allRevocationTokens present in 'AttributeRevocationValues' element NOTE: Applicable only for XAdES revocation source- Specified by:
getAttributeRevocationValuesTokensin interfaceAdvancedSignature- Returns:
- list of
RevocationTokens
-
getTimestampValidationDataTokens
public List<RevocationToken> getTimestampValidationDataTokens()
Description copied from interface:AdvancedSignatureRetrieves the list of allRevocationTokens present in 'TimestampValidationData/RevocationValues' element NOTE: Applicable only for XAdES revocation source- Specified by:
getTimestampValidationDataTokensin interfaceAdvancedSignature- Returns:
- list of
RevocationTokens
-
getDSSDictionaryRevocationTokens
public List<RevocationToken> getDSSDictionaryRevocationTokens()
Description copied from interface:AdvancedSignatureRetrieves the list of allRevocationTokens present in 'DSS' dictionary NOTE: Applicable only for PAdES revocation source- Specified by:
getDSSDictionaryRevocationTokensin interfaceAdvancedSignature- Returns:
- list of
RevocationTokens
-
getVRIDictionaryRevocationTokens
public List<RevocationToken> getVRIDictionaryRevocationTokens()
Description copied from interface:AdvancedSignatureRetrieves the list of allRevocationTokens present in 'VRI' dictionary NOTE: Applicable only for PAdES revocation source- Specified by:
getVRIDictionaryRevocationTokensin interfaceAdvancedSignature- Returns:
- list of
RevocationTokens
-
getCompleteRevocationCRLReferences
public List<CRLRef> getCompleteRevocationCRLReferences()
Description copied from interface:AdvancedSignatureRetrieves a list of allCRLRefs present in 'CompleteRevocationRefs' element NOTE: Applicable only for XAdES and CAdES revocation sources- Specified by:
getCompleteRevocationCRLReferencesin interfaceAdvancedSignature- Returns:
- list of
CRLRefs
-
getAttributeRevocationCRLReferences
public List<CRLRef> getAttributeRevocationCRLReferences()
Description copied from interface:AdvancedSignatureRetrieves a list of allCRLRefs present in 'AttributeRevocationRefs' element NOTE: Applicable only for XAdES and CAdES revocation sources- Specified by:
getAttributeRevocationCRLReferencesin interfaceAdvancedSignature- Returns:
- list of
CRLRefs
-
getTimestampRevocationCRLReferences
public List<CRLRef> getTimestampRevocationCRLReferences()
Description copied from interface:AdvancedSignatureRetrieves a list of allCRLRefs present in a timestamp element NOTE: Applicable only for CAdES revocation source- Specified by:
getTimestampRevocationCRLReferencesin interfaceAdvancedSignature- Returns:
- list of
CRLRefs
-
getCompleteRevocationOCSPReferences
public List<OCSPRef> getCompleteRevocationOCSPReferences()
Description copied from interface:AdvancedSignatureRetrieves a list of allOCSPRefs present in 'CompleteRevocationRefs' element NOTE: Applicable only for XAdES and CAdES revocation sources- Specified by:
getCompleteRevocationOCSPReferencesin interfaceAdvancedSignature- Returns:
- list of
OCSPRefs
-
getAttributeRevocationOCSPReferences
public List<OCSPRef> getAttributeRevocationOCSPReferences()
Description copied from interface:AdvancedSignatureRetrieves a list of allOCSPRefs present in 'AttributeRevocationRefs' element NOTE: Applicable only for XAdES and CAdES revocation sources- Specified by:
getAttributeRevocationOCSPReferencesin interfaceAdvancedSignature- Returns:
- list of
OCSPRefs
-
getTimestampRevocationOCSPReferences
public List<OCSPRef> getTimestampRevocationOCSPReferences()
Description copied from interface:AdvancedSignatureRetrieves a list of allOCSPRefs present in a timestamp element NOTE: Applicable only for CAdES revocation source- Specified by:
getTimestampRevocationOCSPReferencesin interfaceAdvancedSignature- Returns:
- list of
OCSPRefs
-
getAllFoundRevocationRefs
public List<RevocationRef> getAllFoundRevocationRefs()
Description copied from interface:AdvancedSignatureRetrieves a list of all foundRevocationRefs present in the signature- Specified by:
getAllFoundRevocationRefsin interfaceAdvancedSignature- Returns:
- list of
RevocationRefs
-
getOrphanRevocationRefs
public List<RevocationRef> getOrphanRevocationRefs()
Description copied from interface:AdvancedSignatureReturns a list of all orphanRevocationRefs found into the signature- Specified by:
getOrphanRevocationRefsin interfaceAdvancedSignature- Returns:
- list of
RevocationRefs
-
getCompleteRevocationTokens
public List<RevocationToken> getCompleteRevocationTokens()
Description copied from interface:AdvancedSignatureRetrieves the list of allRevocationTokens present in 'CompleteRevocationRefs' element NOTE: Applicable only for XAdES and CAdES revocation sources- Specified by:
getCompleteRevocationTokensin interfaceAdvancedSignature- Returns:
- list of
RevocationTokens
-
getAttributeRevocationTokens
public List<RevocationToken> getAttributeRevocationTokens()
Description copied from interface:AdvancedSignatureRetrieves the list of allRevocationTokens present in 'AttributeRevocationRefs' element NOTE: Applicable only for XAdES and CAdES revocation sources- Specified by:
getAttributeRevocationTokensin interfaceAdvancedSignature- Returns:
- list of
RevocationTokens
-
findRefsForRevocationToken
public List<RevocationRef> findRefsForRevocationToken(RevocationToken revocationToken)
Description copied from interface:AdvancedSignatureRetrieves a list of foundRevocationRefs for the givenrevocationToken- Specified by:
findRefsForRevocationTokenin interfaceAdvancedSignature- Parameters:
revocationToken-RevocationTokento get references for- Returns:
- list of
RevocationRefs
-
findRefsForRevocationIdentifier
public List<RevocationRef> findRefsForRevocationIdentifier(EncapsulatedRevocationTokenIdentifier revocationIdentifier)
Description copied from interface:AdvancedSignatureRetrieves a list of foundRevocationRefs for the givenrevocationIdentifier- Specified by:
findRefsForRevocationIdentifierin interfaceAdvancedSignature- Parameters:
revocationIdentifier-EncapsulatedRevocationTokenIdentifierto get references for- Returns:
- list of
RevocationRefs
-
getAllFoundRevocationIdentifiers
public List<EncapsulatedRevocationTokenIdentifier> getAllFoundRevocationIdentifiers()
Description copied from interface:AdvancedSignatureReturns a list of allEncapsulatedRevocationTokenIdentifiers found in CRL and OCSP sources- Specified by:
getAllFoundRevocationIdentifiersin interfaceAdvancedSignature- Returns:
- list of all
EncapsulatedRevocationTokenIdentifiers
-
isDocHashOnlyValidation
public boolean isDocHashOnlyValidation()
Description copied from interface:AdvancedSignatureReturns true if the validation of the signature has been performed only on Signer's Document Representation (SDR). (An SDR typically is built on a cryptographic hash of the Signer's Document)- Specified by:
isDocHashOnlyValidationin interfaceAdvancedSignature- Returns:
- true of it is DocHashOnly validation, false otherwise
-
isHashOnlyValidation
public boolean isHashOnlyValidation()
Description copied from interface:AdvancedSignatureReturns true if the validation of the signature has been performed only on Data To Be Signed Representation (DTBSR). EN 319 102-1 v1.1.1 (4.2.8 Data to be signed representation (DTBSR)): The DTBS preparation component shall take the DTBSF and hash it according to the hash algorithm specified in the cryptographic suite. The result of this process is the DTBSR, which is then used to create the signature. NOTE: In order for the produced hash to be representative of the DTBSF, the hashing function has the property that it is computationally infeasible to find collisions for the expected signature lifetime. Should the hash function become weak in the future, additional security measures, such as applying time-stamp tokens, can be taken.- Specified by:
isHashOnlyValidationin interfaceAdvancedSignature- Returns:
- true of it is HashOnly validation, false otherwise
-
getMessageDigestValue
public byte[] getMessageDigestValue()
- Specified by:
getMessageDigestValuein interfaceAdvancedSignature
-
getSignatureFieldName
public String getSignatureFieldName()
- Specified by:
getSignatureFieldNamein interfaceAdvancedSignature
-
getSignerName
public String getSignerName()
- Specified by:
getSignerNamein interfaceAdvancedSignature
-
getFilter
public String getFilter()
- Specified by:
getFilterin interfaceAdvancedSignature
-
getSubFilter
public String getSubFilter()
- Specified by:
getSubFilterin interfaceAdvancedSignature
-
getContactInfo
public String getContactInfo()
- Specified by:
getContactInfoin interfaceAdvancedSignature
-
getReason
public String getReason()
- Specified by:
getReasonin interfaceAdvancedSignature
-
getSignatureByteRange
public int[] getSignatureByteRange()
- Specified by:
getSignatureByteRangein interfaceAdvancedSignature
-
-