Class CAdESSignatureExtension
java.lang.Object
eu.europa.esig.dss.cades.signature.CAdESSignatureExtension
- Direct Known Subclasses:
CAdESLevelBaselineT
Base class for extending a CAdESSignature.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final eu.europa.esig.dss.spi.validation.CertificateVerifierThe CertificateVerifier to useprotected eu.europa.esig.dss.spi.signature.resources.DSSResourcesHandlerBuilderThis object is used to create data container objects such as an OutputStream or a DSSDocumentprotected final eu.europa.esig.dss.spi.x509.tsp.TSPSourceThe TSPSource to request a timestamp (T- and LTA-levels) -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCAdESSignatureExtension(eu.europa.esig.dss.spi.x509.tsp.TSPSource tspSource, eu.europa.esig.dss.spi.validation.CertificateVerifier certificateVerifier) The default constructor -
Method Summary
Modifier and TypeMethodDescriptioneu.europa.esig.dss.cms.CMSextendCMSSignatures(eu.europa.esig.dss.cms.CMS cms, CAdESSignatureParameters parameters) Extends aCMSprotected abstract eu.europa.esig.dss.cms.CMSextendCMSSignatures(eu.europa.esig.dss.cms.CMS cms, CAdESSignatureParameters parameters, List<String> signatureIdsToExtend) This method extends the signatures in thecmsSignedDatawith ids listed withinsignatureIdsToExtendprotected eu.europa.esig.dss.cms.CMSextendCMSSignatures(eu.europa.esig.dss.cms.CMS cms, Collection<org.bouncycastle.cms.SignerInformation> signerInformationsToExtend, CAdESSignatureParameters parameters) Loops on each signerInformation of thecmsSignedDataand extends ones defined in the collectionsignerInformationsToExtendeu.europa.esig.dss.cms.CMSextendCMSSignatures(eu.europa.esig.dss.cms.CMS cms, org.bouncycastle.cms.SignerInformation signerInformation, CAdESSignatureParameters parameters) Extends aCMSwith a specifiedSignerInformationNOTE: does not modify otherSignerInformationseu.europa.esig.dss.model.DSSDocumentextendSignatures(eu.europa.esig.dss.model.DSSDocument signatureToExtend, CAdESSignatureParameters parameters) Extends CMS signatures provided within thesignatureToExtenddocumentprotected CMSDocumentAnalyzergetDocumentValidator(eu.europa.esig.dss.cms.CMS cms, CAdESSignatureParameters parameters) This method returns a document validator for aCMSprotected org.bouncycastle.asn1.ASN1ObjectgetTimeStampAttributeValue(eu.europa.esig.dss.model.DSSMessageDigest timestampMessageDigest, eu.europa.esig.dss.enumerations.DigestAlgorithm timestampDigestAlgorithm, org.bouncycastle.asn1.cms.Attribute... attributesForTimestampToken) Generates and returns a TimeStamp attribute valueprotected eu.europa.esig.dss.cms.CMSreplaceSigners(eu.europa.esig.dss.cms.CMS originalCMS, List<org.bouncycastle.cms.SignerInformation> newSignerInformationList) This method replaces the signers within the providedoriginalCMSvoidsetResourcesHandlerBuilder(eu.europa.esig.dss.spi.signature.resources.DSSResourcesHandlerBuilder resourcesHandlerBuilder) This method sets aDSSResourcesHandlerBuilderto be used for operating with internal objects during the signature creation procedure.
-
Field Details
-
tspSource
protected final eu.europa.esig.dss.spi.x509.tsp.TSPSource tspSourceThe TSPSource to request a timestamp (T- and LTA-levels) -
certificateVerifier
protected final eu.europa.esig.dss.spi.validation.CertificateVerifier certificateVerifierThe CertificateVerifier to use -
resourcesHandlerBuilder
protected eu.europa.esig.dss.spi.signature.resources.DSSResourcesHandlerBuilder resourcesHandlerBuilderThis object is used to create data container objects such as an OutputStream or a DSSDocument
-
-
Constructor Details
-
CAdESSignatureExtension
protected CAdESSignatureExtension(eu.europa.esig.dss.spi.x509.tsp.TSPSource tspSource, eu.europa.esig.dss.spi.validation.CertificateVerifier certificateVerifier) The default constructor- Parameters:
tspSource-TSPSourcecertificateVerifier-CertificateVerifier
-
-
Method Details
-
setResourcesHandlerBuilder
public void setResourcesHandlerBuilder(eu.europa.esig.dss.spi.signature.resources.DSSResourcesHandlerBuilder resourcesHandlerBuilder) This method sets aDSSResourcesHandlerBuilderto be used for operating with internal objects during the signature creation procedure.- Parameters:
resourcesHandlerBuilder-DSSResourcesHandlerBuilder
-
extendSignatures
public eu.europa.esig.dss.model.DSSDocument extendSignatures(eu.europa.esig.dss.model.DSSDocument signatureToExtend, CAdESSignatureParameters parameters) Extends CMS signatures provided within thesignatureToExtenddocument- Parameters:
signatureToExtend-DSSDocumentto be extendedparameters-CAdESSignatureParametersof the extension- Returns:
DSSDocumenta new extended document
-
extendCMSSignatures
public eu.europa.esig.dss.cms.CMS extendCMSSignatures(eu.europa.esig.dss.cms.CMS cms, CAdESSignatureParameters parameters) Extends aCMS- Parameters:
cms-CMSto extendparameters-CAdESSignatureParameters- Returns:
CMS
-
extendCMSSignatures
public eu.europa.esig.dss.cms.CMS extendCMSSignatures(eu.europa.esig.dss.cms.CMS cms, org.bouncycastle.cms.SignerInformation signerInformation, CAdESSignatureParameters parameters) Extends aCMSwith a specifiedSignerInformationNOTE: does not modify otherSignerInformations- Parameters:
cms-CMSto extendsignerInformation-SignerInformationto extendparameters-CAdESSignatureParameters- Returns:
CMS
-
extendCMSSignatures
protected eu.europa.esig.dss.cms.CMS extendCMSSignatures(eu.europa.esig.dss.cms.CMS cms, Collection<org.bouncycastle.cms.SignerInformation> signerInformationsToExtend, CAdESSignatureParameters parameters) Loops on each signerInformation of thecmsSignedDataand extends ones defined in the collectionsignerInformationsToExtend- Parameters:
cms-CMSsignerInformationsToExtend- a collection ofSignerInformationto be extendedparameters-CAdESSignatureParametersfor the extension- Returns:
CMSwith extended signerInformations
-
extendCMSSignatures
protected abstract eu.europa.esig.dss.cms.CMS extendCMSSignatures(eu.europa.esig.dss.cms.CMS cms, CAdESSignatureParameters parameters, List<String> signatureIdsToExtend) This method extends the signatures in thecmsSignedDatawith ids listed withinsignatureIdsToExtend- Parameters:
cms-CMScontaining the signatures to be extendedparameters-CAdESSignatureParameterssignatureIdsToExtend- a list ofStringsignature Ids to be extended- Returns:
CMS
-
replaceSigners
protected eu.europa.esig.dss.cms.CMS replaceSigners(eu.europa.esig.dss.cms.CMS originalCMS, List<org.bouncycastle.cms.SignerInformation> newSignerInformationList) This method replaces the signers within the providedoriginalCMS- Parameters:
originalCMS-CMSto replace SignerInformations withinnewSignerInformationList- a list of newSignerInformations- Returns:
CMS
-
getTimeStampAttributeValue
protected org.bouncycastle.asn1.ASN1Object getTimeStampAttributeValue(eu.europa.esig.dss.model.DSSMessageDigest timestampMessageDigest, eu.europa.esig.dss.enumerations.DigestAlgorithm timestampDigestAlgorithm, org.bouncycastle.asn1.cms.Attribute... attributesForTimestampToken) Generates and returns a TimeStamp attribute value- Parameters:
timestampMessageDigest-DSSMessageDigestmessage-digest to be timestampedtimestampDigestAlgorithm-DigestAlgorithmto useattributesForTimestampToken-Attributes to add- Returns:
ASN1Objectrepresenting a TimeStamp token attribute value
-
getDocumentValidator
protected CMSDocumentAnalyzer getDocumentValidator(eu.europa.esig.dss.cms.CMS cms, CAdESSignatureParameters parameters) This method returns a document validator for aCMS- Parameters:
cms-CMSto get validation forparameters-CAdESSignatureParameters- Returns:
CMSDocumentAnalyzer
-