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,eu.europa.esig.dss.validation.AdvancedSignature,Serializable
public class CAdESSignature
extends eu.europa.esig.dss.validation.DefaultAdvancedSignature
CAdES Signature class helper
- 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
ConstructorsConstructorDescriptionCAdESSignature(org.bouncycastle.cms.CMSSignedData cmsSignedData, org.bouncycastle.cms.SignerInformation signerInformation) The default constructor for CAdESSignature. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExternalTimestamp(eu.europa.esig.dss.spi.x509.tsp.TimestampToken timestamp) protected eu.europa.esig.dss.validation.SignaturePolicyvoidprotected CAdESBaselineRequirementsCheckerprotected List<eu.europa.esig.dss.model.scope.SignatureScope>protected CAdESBaselineRequirementsCheckereu.europa.esig.dss.spi.SignatureCertificateSourceList<eu.europa.esig.dss.validation.SignerRole>List<eu.europa.esig.dss.validation.SignerRole>org.bouncycastle.cms.CMSSignedDataGets CMSSignedDataList<eu.europa.esig.dss.validation.CommitmentTypeIndication>Gets Content HintsGets ContentIdentifier StringList<eu.europa.esig.dss.validation.AdvancedSignature>protected org.bouncycastle.cms.SignerInformationStoreReturns a SignerInformationStore containing counter signatureseu.europa.esig.dss.spi.x509.revocation.crl.OfflineCRLSourceeu.europa.esig.dss.enumerations.SignatureLeveleu.europa.esig.dss.model.Digesteu.europa.esig.dss.enumerations.DigestAlgorithmeu.europa.esig.dss.enumerations.EncryptionAlgorithmeu.europa.esig.dss.enumerations.MaskGenerationFunctionSet<eu.europa.esig.dss.enumerations.DigestAlgorithm>Returns a set of usedDigestAlgorithms incorporated into the CMSSignedDatabyte[]Returns a digest value incorporated in an attribute "message-digest" in CMS Signed Dataeu.europa.esig.dss.spi.x509.revocation.ocsp.OfflineOCSPSourceeu.europa.esig.dss.model.DSSDocumentReturns the original signed documentList<eu.europa.esig.dss.model.ReferenceValidation>List<eu.europa.esig.dss.model.ReferenceValidation>getReferenceValidations(org.bouncycastle.cms.SignerInformation signerInformationToCheck) Returns the reference validationeu.europa.esig.dss.enumerations.SignatureAlgorithmeu.europa.esig.dss.validation.SignatureDigestReferencegetSignatureDigestReference(eu.europa.esig.dss.enumerations.DigestAlgorithm digestAlgorithm) TS 119 442 - V1.1.1 - Electronic Signatures and Infrastructures (ESI), ch.eu.europa.esig.dss.enumerations.SignatureFormprotected eu.europa.esig.dss.validation.SignatureIdentifierBuildereu.europa.esig.dss.model.SignaturePolicyStoreeu.europa.esig.dss.validation.SignatureProductionPlacebyte[]List<eu.europa.esig.dss.validation.SignerRole>protected eu.europa.esig.dss.model.DSSDocumentThis method extracts a document content that was signed NOTE: Some differences are possible with PAdESorg.bouncycastle.cms.SignerIdReturnsSignerIdof the related to the signaturesignerInformationorg.bouncycastle.cms.SignerInformationGets a SignedInformationSet<eu.europa.esig.dss.spi.x509.SignerIdentifier>Returns a Set of CertificateIdentifier extracted from a SignerInformationStore of CMS Signed DatabooleanChecks if the signature has the 101733-A profilebooleanChecks the presence of signing certificate covered by the signature, what is the proof -BES profile existencebooleanChecks if the signature has the 101733-C profilebooleanChecks the presence of signature-policy-identifier element in the signature, what is the proof -EPES profile existencebooleanChecks the presence of signature-time-stamp element in the signature, what is the proof -T profile existencebooleanChecks if the signature has the 101733-XL profilebooleanChecks if the signature has the 101733-X profilebooleanMethods inherited from class eu.europa.esig.dss.validation.DefaultAdvancedSignature
addExternalEvidenceRecord, areAllSelfSignedCertificates, equals, findSignatureScope, getAllEvidenceRecords, getAllTimestamps, getArchiveTimestamps, getCandidatesForSigningCertificate, getCertificates, getCompleteCertificateSource, getCompleteCRLSource, getCompleteOCSPSource, getContainerContents, getContentTimestamps, getCounterSignaturesCertificateSource, getCounterSignaturesCRLSource, getCounterSignaturesOCSPSource, getDetachedContents, getDetachedEvidenceRecords, getDetachedTimestamps, getDocumentTimestamps, getDSSId, getEmbeddedEvidenceRecords, 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
-
CAdESSignature
public CAdESSignature(org.bouncycastle.cms.CMSSignedData cmsSignedData, org.bouncycastle.cms.SignerInformation signerInformation) The default constructor for CAdESSignature.- Parameters:
cmsSignedData- CMSSignedDatasignerInformation- 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
-
getSignerId
public org.bouncycastle.cms.SignerId getSignerId()ReturnsSignerIdof the related to the signaturesignerInformation- Returns:
SignerId
-
findSignatureScopes
- Specified by:
findSignatureScopesin classeu.europa.esig.dss.validation.DefaultAdvancedSignature
-
buildSignaturePolicy
protected eu.europa.esig.dss.validation.SignaturePolicy buildSignaturePolicy()- Specified by:
buildSignaturePolicyin classeu.europa.esig.dss.validation.DefaultAdvancedSignature
-
getSignaturePolicyStore
public eu.europa.esig.dss.model.SignaturePolicyStore getSignaturePolicyStore() -
getSigningTime
-
getCmsSignedData
public org.bouncycastle.cms.CMSSignedData getCmsSignedData()Gets CMSSignedData- Returns:
CMSSignedDatathe cmsSignedData
-
getSignatureProductionPlace
public eu.europa.esig.dss.validation.SignatureProductionPlace getSignatureProductionPlace() -
getCommitmentTypeIndications
-
getSignedAssertions
-
getClaimedSignerRoles
-
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<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
-
getSignatureDigestReference
public eu.europa.esig.dss.validation.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
Returns a set of usedDigestAlgorithms 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
-
getMimeType
-
getContentIdentifier
Gets ContentIdentifier String- Returns:
- content identifier as
String
-
getContentHints
Gets Content Hints- Returns:
- content hints as
String
-
getSignerInformation
public org.bouncycastle.cms.SignerInformation getSignerInformation()Gets a SignedInformation- Returns:
SignerInformationthe signerInformation
-
getSignatureValue
public byte[] getSignatureValue() -
isCounterSignature
public boolean isCounterSignature()- Specified by:
isCounterSignaturein interfaceeu.europa.esig.dss.validation.AdvancedSignature- Overrides:
isCounterSignaturein classeu.europa.esig.dss.validation.DefaultAdvancedSignature
-
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.validation.SignatureIdentifierBuilder getSignatureIdentifierBuilder()- Specified by:
getSignatureIdentifierBuilderin classeu.europa.esig.dss.validation.DefaultAdvancedSignature
-
getDAIdentifier
-
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
- Overrides:
getBaselineRequirementsCheckerin classeu.europa.esig.dss.validation.DefaultAdvancedSignature
-
createBaselineRequirementsChecker
- Specified by:
createBaselineRequirementsCheckerin classeu.europa.esig.dss.validation.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
-