Class CAdESSignature

java.lang.Object
eu.europa.esig.dss.cades.validation.CAdESSignature
All Implemented Interfaces:
Serializable

public class CAdESSignature extends Object
CAdES Signature class helper
See Also:
  • Field Details

    • detachedContents

      protected List<eu.europa.esig.dss.model.DSSDocument> detachedContents
    • manifestFile

      protected eu.europa.esig.dss.model.ManifestFile manifestFile
    • referenceValidations

      protected List<eu.europa.esig.dss.model.ReferenceValidation> referenceValidations
    • signatureCryptographicVerification

      protected eu.europa.esig.dss.model.signature.SignatureCryptographicVerification signatureCryptographicVerification
    • structureValidationMessages

      protected List<String> structureValidationMessages
    • signingCertificateSource

      protected eu.europa.esig.dss.spi.x509.CertificateSource signingCertificateSource
    • offlineCertificateSource

      protected eu.europa.esig.dss.spi.SignatureCertificateSource offlineCertificateSource
    • signatureCRLSource

      protected eu.europa.esig.dss.spi.x509.revocation.crl.OfflineCRLSource signatureCRLSource
    • signatureOCSPSource

      protected eu.europa.esig.dss.spi.x509.revocation.ocsp.OfflineOCSPSource signatureOCSPSource
    • signatureTimestampSource

      protected eu.europa.esig.dss.spi.x509.tsp.TimestampSource signatureTimestampSource
    • counterSignatures

      protected List<eu.europa.esig.dss.spi.signature.AdvancedSignature> counterSignatures
    • signaturePolicy

      protected eu.europa.esig.dss.model.signature.SignaturePolicy signaturePolicy
    • signatureIdentifier

      protected eu.europa.esig.dss.spi.signature.identifier.SignatureIdentifier signatureIdentifier
  • Constructor Details

    • CAdESSignature

      public CAdESSignature(eu.europa.esig.dss.cms.CMS cms, org.bouncycastle.cms.SignerInformation signerInformation)
      The default constructor for CAdESSignature.
      Parameters:
      cms - CMS
      signerInformation - an expanded SignerInfo block from a CMS Signed message
  • Method Details

    • getSignatureForm

      public eu.europa.esig.dss.enumerations.SignatureForm getSignatureForm()
    • getCertificateSource

      public eu.europa.esig.dss.spi.SignatureCertificateSource getCertificateSource()
    • getCRLSource

      public eu.europa.esig.dss.spi.x509.revocation.crl.OfflineCRLSource getCRLSource()
    • getOCSPSource

      public eu.europa.esig.dss.spi.x509.revocation.ocsp.OfflineOCSPSource getOCSPSource()
    • getTimestampSource

      public CAdESTimestampSource getTimestampSource()
    • getSignerId

      public org.bouncycastle.cms.SignerId getSignerId()
      Returns SignerId of the related to the signature signerInformation
      Returns:
      SignerId
    • findSignatureScopes

      protected List<eu.europa.esig.dss.model.scope.SignatureScope> findSignatureScopes()
    • buildSignaturePolicy

      protected eu.europa.esig.dss.model.signature.SignaturePolicy buildSignaturePolicy()
    • getSignaturePolicyStore

      public eu.europa.esig.dss.model.SignaturePolicyStore getSignaturePolicyStore()
    • getSigningTime

      public Date getSigningTime()
    • getCMS

      public eu.europa.esig.dss.cms.CMS getCMS()
      Gets CMS
      Returns:
      CMS the cms
    • getSignatureProductionPlace

      public eu.europa.esig.dss.model.signature.SignatureProductionPlace getSignatureProductionPlace()
    • getCommitmentTypeIndications

      public List<eu.europa.esig.dss.model.signature.CommitmentTypeIndication> getCommitmentTypeIndications()
    • getSignedAssertions

      public List<eu.europa.esig.dss.model.signature.SignerRole> getSignedAssertions()
    • getClaimedSignerRoles

      public List<eu.europa.esig.dss.model.signature.SignerRole> getClaimedSignerRoles()
    • getCertifiedSignerRoles

      public List<eu.europa.esig.dss.model.signature.SignerRole> getCertifiedSignerRoles()
    • getEncryptionAlgorithm

      public eu.europa.esig.dss.enumerations.EncryptionAlgorithm getEncryptionAlgorithm()
    • getDigestAlgorithm

      public eu.europa.esig.dss.enumerations.DigestAlgorithm getDigestAlgorithm()
    • getSignatureAlgorithm

      public eu.europa.esig.dss.enumerations.SignatureAlgorithm getSignatureAlgorithm()
    • checkSignatureIntegrity

      public void checkSignatureIntegrity()
    • getReferenceValidations

      public List<eu.europa.esig.dss.model.ReferenceValidation> getReferenceValidations(org.bouncycastle.cms.SignerInformation signerInformationToCheck)
      Returns the reference validation
      Parameters:
      signerInformationToCheck - SignerInformation
      Returns:
      a list of ReferenceValidations
    • getSignerDocumentContent

      protected eu.europa.esig.dss.model.DSSDocument getSignerDocumentContent()
      This method extracts a document content that was signed

      NOTE: Some differences are possible with PAdES

      Returns:
      DSSDocument
    • getReferenceValidations

      public List<eu.europa.esig.dss.model.ReferenceValidation> getReferenceValidations()
    • getSignatureDigestReference

      public eu.europa.esig.dss.model.signature.SignatureDigestReference getSignatureDigestReference(eu.europa.esig.dss.enumerations.DigestAlgorithm digestAlgorithm)
      TS 119 442 - V1.1.1 - Electronic Signatures and Infrastructures (ESI), ch. 5.1.4.2.1.3 XML component:

      In case of CAdES signatures, the input to the digest value computation shall be one of the DER-encoded instances of SignedInfo type present within the CMS structure.

    • getDataToBeSignedRepresentation

      public eu.europa.esig.dss.model.Digest getDataToBeSignedRepresentation()
    • getMessageDigestAlgorithms

      public Set<eu.europa.esig.dss.enumerations.DigestAlgorithm> getMessageDigestAlgorithms()
      Returns a set of used DigestAlgorithms incorporated into the CMS
      Returns:
      a set of DigestAlgorithms
    • getMessageDigestValue

      public byte[] getMessageDigestValue()
      Returns a digest value incorporated in an attribute "message-digest" in CMS Signed Data
      Returns:
      a byte array representing a signed content digest value
    • getContentType

      public String getContentType()
    • getMimeType

      public String getMimeType()
    • getContentIdentifier

      public String getContentIdentifier()
      Gets ContentIdentifier String
      Returns:
      content identifier as String
    • getContentHints

      public String getContentHints()
      Gets Content Hints
      Returns:
      content hints as String
    • getSignerInformation

      public org.bouncycastle.cms.SignerInformation getSignerInformation()
      Gets a SignedInformation
      Returns:
      SignerInformation the signerInformation
    • getSignatureValue

      public byte[] getSignatureValue()
    • isCounterSignature

      public boolean isCounterSignature()
    • getCounterSignatures

      public List<eu.europa.esig.dss.spi.signature.AdvancedSignature> getCounterSignatures()
    • getCounterSignatureStore

      protected org.bouncycastle.cms.SignerInformationStore getCounterSignatureStore()
      Returns a SignerInformationStore containing counter signatures
      Returns:
      SignerInformationStore
    • getOriginalDocument

      public eu.europa.esig.dss.model.DSSDocument getOriginalDocument()
      Returns the original signed document
      Returns:
      DSSDocument
    • getSignatureIdentifierBuilder

      protected eu.europa.esig.dss.spi.signature.identifier.SignatureIdentifierBuilder getSignatureIdentifierBuilder()
    • getDAIdentifier

      public String getDAIdentifier()
    • getSignerInformationStoreInfos

      public Set<eu.europa.esig.dss.spi.x509.SignerIdentifier> getSignerInformationStoreInfos()
      Returns a Set of CertificateIdentifier extracted from a SignerInformationStore of CMS Signed Data
      Returns:
      a Set of SignerIdentifiers
    • addExternalTimestamp

      public void addExternalTimestamp(eu.europa.esig.dss.spi.x509.tsp.TimestampToken timestamp)
    • getDataFoundUpToLevel

      public eu.europa.esig.dss.enumerations.SignatureLevel getDataFoundUpToLevel()
    • getBaselineRequirementsChecker

      protected CAdESBaselineRequirementsChecker getBaselineRequirementsChecker()
    • createBaselineRequirementsChecker

      protected CAdESBaselineRequirementsChecker createBaselineRequirementsChecker(eu.europa.esig.dss.spi.validation.CertificateVerifier certificateVerifier)
    • setSigningCertificateSource

      public void setSigningCertificateSource(eu.europa.esig.dss.spi.x509.CertificateSource arg0)
    • getFilename

      public String getFilename()
    • setFilename

      public void setFilename(String arg0)
    • getDetachedContents

      public List<eu.europa.esig.dss.model.DSSDocument> getDetachedContents()
    • setDetachedContents

      public void setDetachedContents(List<eu.europa.esig.dss.model.DSSDocument> arg0)
    • getContainerContents

      public List<eu.europa.esig.dss.model.DSSDocument> getContainerContents()
    • setContainerContents

      public void setContainerContents(List<eu.europa.esig.dss.model.DSSDocument> arg0)
    • getManifestFile

      public eu.europa.esig.dss.model.ManifestFile getManifestFile()
    • setManifestFile

      public void setManifestFile(eu.europa.esig.dss.model.ManifestFile arg0)
    • getDSSId

      public eu.europa.esig.dss.spi.signature.identifier.SignatureIdentifier getDSSId()
    • getId

      public String getId()
    • getCompleteCertificateSource

      public eu.europa.esig.dss.spi.x509.ListCertificateSource getCompleteCertificateSource()
    • getCompleteCRLSource

      public eu.europa.esig.dss.spi.x509.revocation.ListRevocationSource<eu.europa.esig.dss.model.x509.revocation.crl.CRL> getCompleteCRLSource()
    • getCompleteOCSPSource

      public eu.europa.esig.dss.spi.x509.revocation.ListRevocationSource<eu.europa.esig.dss.model.x509.revocation.ocsp.OCSP> getCompleteOCSPSource()
    • getCounterSignaturesCertificateSource

      protected eu.europa.esig.dss.spi.x509.ListCertificateSource getCounterSignaturesCertificateSource()
    • getCounterSignaturesCRLSource

      protected eu.europa.esig.dss.spi.x509.revocation.ListRevocationSource<eu.europa.esig.dss.model.x509.revocation.crl.CRL> getCounterSignaturesCRLSource()
    • getCounterSignaturesOCSPSource

      protected eu.europa.esig.dss.spi.x509.revocation.ListRevocationSource<eu.europa.esig.dss.model.x509.revocation.ocsp.OCSP> getCounterSignaturesOCSPSource()
    • resetCertificateSource

      public void resetCertificateSource()
    • resetRevocationSources

      public void resetRevocationSources()
    • resetTimestampSource

      public void resetTimestampSource()
    • getCandidatesForSigningCertificate

      public eu.europa.esig.dss.spi.x509.CandidatesForSigningCertificate getCandidatesForSigningCertificate()
    • initBaselineRequirementsChecker

      public void initBaselineRequirementsChecker(eu.europa.esig.dss.spi.validation.CertificateVerifier arg0)
    • getCertificates

      public List<eu.europa.esig.dss.model.x509.CertificateToken> getCertificates()
    • setMasterSignature

      public void setMasterSignature(eu.europa.esig.dss.spi.signature.AdvancedSignature arg0)
    • getMasterSignature

      public eu.europa.esig.dss.spi.signature.AdvancedSignature getMasterSignature()
    • getSignatureCryptographicVerification

      public eu.europa.esig.dss.model.signature.SignatureCryptographicVerification getSignatureCryptographicVerification()
    • getSignerRoles

      public List<eu.europa.esig.dss.model.signature.SignerRole> getSignerRoles()
    • getSigningCertificateToken

      public eu.europa.esig.dss.model.x509.CertificateToken getSigningCertificateToken()
    • getStructureValidationResult

      public List<String> getStructureValidationResult()
    • validateStructure

      protected List<String> validateStructure()
    • getSignatureScopes

      public List<eu.europa.esig.dss.model.scope.SignatureScope> getSignatureScopes()
    • getContentTimestamps

      public List<eu.europa.esig.dss.spi.x509.tsp.TimestampToken> getContentTimestamps()
    • getSignatureTimestamps

      public List<eu.europa.esig.dss.spi.x509.tsp.TimestampToken> getSignatureTimestamps()
    • getTimestampsX1

      public List<eu.europa.esig.dss.spi.x509.tsp.TimestampToken> getTimestampsX1()
    • getTimestampsX2

      public List<eu.europa.esig.dss.spi.x509.tsp.TimestampToken> getTimestampsX2()
    • getArchiveTimestamps

      public List<eu.europa.esig.dss.spi.x509.tsp.TimestampToken> getArchiveTimestamps()
    • getDocumentTimestamps

      public List<eu.europa.esig.dss.spi.x509.tsp.TimestampToken> getDocumentTimestamps()
    • getDetachedTimestamps

      public List<eu.europa.esig.dss.spi.x509.tsp.TimestampToken> getDetachedTimestamps()
    • getAllTimestamps

      public List<eu.europa.esig.dss.spi.x509.tsp.TimestampToken> getAllTimestamps()
    • getEmbeddedEvidenceRecords

      public List<eu.europa.esig.dss.spi.x509.evidencerecord.EvidenceRecord> getEmbeddedEvidenceRecords()
    • addExternalEvidenceRecord

      public void addExternalEvidenceRecord(eu.europa.esig.dss.spi.x509.evidencerecord.EvidenceRecord arg0)
    • getDetachedEvidenceRecords

      public List<eu.europa.esig.dss.spi.x509.evidencerecord.EvidenceRecord> getDetachedEvidenceRecords()
    • getAllEvidenceRecords

      public List<eu.europa.esig.dss.spi.x509.evidencerecord.EvidenceRecord> getAllEvidenceRecords()
    • getSignaturePolicy

      public eu.europa.esig.dss.model.signature.SignaturePolicy getSignaturePolicy()
    • hasBProfile

      public boolean hasBProfile()
    • hasTProfile

      public boolean hasTProfile()
    • hasLTProfile

      public boolean hasLTProfile()
    • hasLTAProfile

      public boolean hasLTAProfile()
    • hasBESProfile

      public boolean hasBESProfile()
    • hasEPESProfile

      public boolean hasEPESProfile()
    • hasExtendedTProfile

      public boolean hasExtendedTProfile()
    • hasCProfile

      public boolean hasCProfile()
    • hasXProfile

      public boolean hasXProfile()
    • hasXLProfile

      public boolean hasXLProfile()
    • hasAProfile

      public boolean hasAProfile()
    • hasERSProfile

      public boolean hasERSProfile()
    • areAllSelfSignedCertificates

      public boolean areAllSelfSignedCertificates()
    • isDocHashOnlyValidation

      public boolean isDocHashOnlyValidation()
    • isHashOnlyValidation

      public boolean isHashOnlyValidation()
    • equals

      public boolean equals(Object arg0)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object