Class CAdESSignature

java.lang.Object
eu.europa.esig.dss.validation.DefaultAdvancedSignature
eu.europa.esig.dss.cades.validation.CAdESSignature
All Implemented Interfaces:
eu.europa.esig.dss.model.identifier.IdentifierBasedObject, AdvancedSignature, Serializable

public class CAdESSignature extends DefaultAdvancedSignature
CAdES Signature class helper
See Also:
  • Constructor Details

    • CAdESSignature

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

    • getSignatureForm

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

      public 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
    • buildSignaturePolicy

      protected SignaturePolicy buildSignaturePolicy()
      Specified by:
      buildSignaturePolicy in class DefaultAdvancedSignature
    • getSignaturePolicyStore

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

      public Date getSigningTime()
    • getCmsSignedData

      public org.bouncycastle.cms.CMSSignedData getCmsSignedData()
      Gets CMSSignedData
      Returns:
      CMSSignedData the cmsSignedData
    • getSignatureProductionPlace

      public SignatureProductionPlace getSignatureProductionPlace()
    • getCommitmentTypeIndications

      public List<CommitmentTypeIndication> getCommitmentTypeIndications()
    • getSignedAssertions

      public List<SignerRole> getSignedAssertions()
    • getClaimedSignerRoles

      public List<SignerRole> getClaimedSignerRoles()
    • getCertifiedSignerRoles

      public List<SignerRole> getCertifiedSignerRoles()
    • getEncryptionAlgorithm

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

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

      public eu.europa.esig.dss.enumerations.MaskGenerationFunction getMaskGenerationFunction()
    • getSignatureAlgorithm

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

      public void checkSignatureIntegrity()
    • getReferenceValidations

      public List<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<ReferenceValidation> getReferenceValidations()
    • getSignatureDigestReference

      public 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 CMSSignedData
      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()
      Specified by:
      isCounterSignature in interface AdvancedSignature
      Overrides:
      isCounterSignature in class DefaultAdvancedSignature
    • getCounterSignatures

      public List<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 SignatureIdentifierBuilder getSignatureIdentifierBuilder()
      Specified by:
      getSignatureIdentifierBuilder in class DefaultAdvancedSignature
    • 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(TimestampToken timestamp)
    • getDataFoundUpToLevel

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

      protected CAdESBaselineRequirementsChecker getBaselineRequirementsChecker()
      Overrides:
      getBaselineRequirementsChecker in class DefaultAdvancedSignature
    • createBaselineRequirementsChecker

      protected CAdESBaselineRequirementsChecker createBaselineRequirementsChecker()
      Specified by:
      createBaselineRequirementsChecker in class DefaultAdvancedSignature
    • hasBESProfile

      public boolean hasBESProfile()
      Checks the presence of signing certificate covered by the signature, what is the proof -BES profile existence
      Returns:
      true if BES Profile is detected
    • hasEPESProfile

      public boolean hasEPESProfile()
      Checks the presence of signature-policy-identifier element in the signature, what is the proof -EPES profile existence
      Returns:
      true if EPES Profile is detected
    • hasExtendedTProfile

      public boolean hasExtendedTProfile()
      Checks the presence of signature-time-stamp element in the signature, what is the proof -T profile existence
      Returns:
      true if T Profile is detected
    • hasCProfile

      public boolean hasCProfile()
      Checks if the signature has the 101733-C profile
      Returns:
      TRUE if the signature has a 101733-C profile, FALSE otherwise
    • hasXProfile

      public boolean hasXProfile()
      Checks if the signature has the 101733-X profile
      Returns:
      TRUE if the signature has a 101733-X profile, FALSE otherwise
    • hasXLProfile

      public boolean hasXLProfile()
      Checks if the signature has the 101733-XL profile
      Returns:
      TRUE if the signature has a 101733-XL profile, FALSE otherwise
    • hasAProfile

      public boolean hasAProfile()
      Checks if the signature has the 101733-A profile
      Returns:
      TRUE if the signature has a 101733-A profile, FALSE otherwise