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
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(TimestampToken timestamp) protected SignaturePolicyvoidprotected CAdESBaselineRequirementsCheckerprotected CAdESBaselineRequirementsCheckerorg.bouncycastle.cms.CMSSignedDataGets CMSSignedDataGets Content HintsGets ContentIdentifier Stringprotected 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 documentgetReferenceValidations(org.bouncycastle.cms.SignerInformation signerInformationToCheck) Returns the reference validationeu.europa.esig.dss.enumerations.SignatureAlgorithmgetSignatureDigestReference(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 SignatureIdentifierBuildereu.europa.esig.dss.model.SignaturePolicyStorebyte[]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
areAllSelfSignedCertificates, equals, findSignatureScope, getAllTimestamps, getArchiveTimestamps, getCandidatesForSigningCertificate, getCertificates, getCompleteCertificateSource, getCompleteCRLSource, getCompleteOCSPSource, getContainerContents, getContentTimestamps, getCounterSignaturesCertificateSource, getCounterSignaturesCRLSource, getCounterSignaturesOCSPSource, getDetachedContents, getDetachedTimestamps, getDocumentTimestamps, 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
-
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
-
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
-
buildSignaturePolicy
- Specified by:
buildSignaturePolicyin classDefaultAdvancedSignature
-
getSignaturePolicyStore
public eu.europa.esig.dss.model.SignaturePolicyStore getSignaturePolicyStore() -
getSigningTime
-
getCmsSignedData
public org.bouncycastle.cms.CMSSignedData getCmsSignedData()Gets CMSSignedData- Returns:
CMSSignedDatathe cmsSignedData
-
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<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 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 interfaceAdvancedSignature- Overrides:
isCounterSignaturein classDefaultAdvancedSignature
-
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
- Specified by:
getSignatureIdentifierBuilderin classDefaultAdvancedSignature
-
getDAIdentifier
-
getSignerInformationStoreInfos
Returns a Set of CertificateIdentifier extracted from a SignerInformationStore of CMS Signed Data- Returns:
- a Set of
SignerIdentifiers
-
addExternalTimestamp
-
getDataFoundUpToLevel
public eu.europa.esig.dss.enumerations.SignatureLevel getDataFoundUpToLevel() -
getBaselineRequirementsChecker
- Overrides:
getBaselineRequirementsCheckerin classDefaultAdvancedSignature
-
createBaselineRequirementsChecker
- Specified by:
createBaselineRequirementsCheckerin classDefaultAdvancedSignature
-
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
-