Class CAdESLevelBaselineLT
java.lang.Object
eu.europa.esig.dss.cades.signature.CAdESLevelBaselineT
eu.europa.esig.dss.cades.signature.CAdESLevelBaselineLT
- All Implemented Interfaces:
SignatureExtension<CAdESSignatureParameters>
- Direct Known Subclasses:
CAdESLevelBaselineLTA
This class holds the CAdES-LT signature profiles
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final CertificateVerifier
The CertificateVerifier to useprotected DSSResourcesHandlerBuilder
This object is used to create data container objects such as an OutputStream or a DSSDocumentprotected final TSPSource
The TSPSource to request a timestamp (T- and LTA-levels) -
Constructor Summary
ConstructorsConstructorDescriptionCAdESLevelBaselineLT
(TSPSource tspSource, CertificateVerifier certificateVerifier) The default constructor. -
Method Summary
Modifier and TypeMethodDescriptionextendCMSSignatures
(CMS cms, CAdESSignatureParameters parameters) Extends aCMS
protected CMS
extendCMSSignatures
(CMS cms, CAdESSignatureParameters parameters, List<String> signatureIdsToExtend) This method extends the signatures in thecmsSignedData
with ids listed withinsignatureIdsToExtend
protected CMS
extendCMSSignatures
(CMS cms, Collection<org.bouncycastle.cms.SignerInformation> signerInformationsToExtend, CAdESSignatureParameters parameters) Loops on each signerInformation of thecmsSignedData
and extends ones defined in the collectionsignerInformationsToExtend
extendCMSSignatures
(CMS cms, org.bouncycastle.cms.SignerInformation signerInformation, CAdESSignatureParameters parameters) Extends aCMS
with a specifiedSignerInformation
NOTE: does not modify otherSignerInformation
sextendSignatures
(DSSDocument signatureToExtend, CAdESSignatureParameters parameters) Extends CMS signatures provided within thesignatureToExtend
documentprotected CMSDocumentAnalyzer
getDocumentValidator
(CMS cms, CAdESSignatureParameters parameters) This method returns a document validator for aCMS
protected List
<AdvancedSignature> getExtendToLTLevelSignatures
(List<AdvancedSignature> signatures, List<String> signatureIdsToExtend) Returns a list of signatures to be extended according to th list ofsignatureIdsToExtend
protected org.bouncycastle.asn1.ASN1Object
getTimeStampAttributeValue
(DSSMessageDigest timestampMessageDigest, DigestAlgorithm timestampDigestAlgorithm, org.bouncycastle.asn1.cms.Attribute... attributesForTimestampToken) Generates and returns a TimeStamp attribute valueprotected boolean
includesATSv2
(CMS cms) Verifies if the CMS contains an ATSTv2protected CMS
replaceSigners
(CMS originalCMS, List<org.bouncycastle.cms.SignerInformation> newSignerInformationList) This method replaces the signers within the providedoriginalCMS
void
setResourcesHandlerBuilder
(DSSResourcesHandlerBuilder resourcesHandlerBuilder) This method sets aDSSResourcesHandlerBuilder
to be used for operating with internal objects during the signature creation procedure.Methods inherited from class eu.europa.esig.dss.cades.signature.CAdESLevelBaselineT
getSignatureRequirementsChecker
-
Field Details
-
tspSource
The TSPSource to request a timestamp (T- and LTA-levels) -
certificateVerifier
The CertificateVerifier to use -
resourcesHandlerBuilder
This object is used to create data container objects such as an OutputStream or a DSSDocument
-
-
Constructor Details
-
CAdESLevelBaselineLT
The default constructor.- Parameters:
tspSource
-TSPSource
for a timestamp creationcertificateVerifier
-CertificateVerifier
-
-
Method Details
-
extendCMSSignatures
protected CMS extendCMSSignatures(CMS cms, CAdESSignatureParameters parameters, List<String> signatureIdsToExtend) This method extends the signatures in thecmsSignedData
with ids listed withinsignatureIdsToExtend
- Overrides:
extendCMSSignatures
in classCAdESLevelBaselineT
- Parameters:
cms
-CMS
containing the signatures to be extendedparameters
-CAdESSignatureParameters
signatureIdsToExtend
- a list ofString
signature Ids to be extended- Returns:
CMS
-
includesATSv2
Verifies if the CMS contains an ATSTv2- Parameters:
cms
-CMS
to check- Returns:
- TRUE if the
cms
contains an ATSTv2, FALSE otherwise
-
getExtendToLTLevelSignatures
protected List<AdvancedSignature> getExtendToLTLevelSignatures(List<AdvancedSignature> signatures, List<String> signatureIdsToExtend) Returns a list of signatures to be extended according to th list ofsignatureIdsToExtend
- Parameters:
signatures
- a list ofAdvancedSignature
ssignatureIdsToExtend
- a list ofString
signature identifiers to be extended- Returns:
- a list of
AdvancedSignature
s
-
setResourcesHandlerBuilder
This method sets aDSSResourcesHandlerBuilder
to be used for operating with internal objects during the signature creation procedure.- Parameters:
resourcesHandlerBuilder
-DSSResourcesHandlerBuilder
-
extendSignatures
public DSSDocument extendSignatures(DSSDocument signatureToExtend, CAdESSignatureParameters parameters) Extends CMS signatures provided within thesignatureToExtend
document- Specified by:
extendSignatures
in interfaceSignatureExtension<CAdESSignatureParameters>
- Parameters:
signatureToExtend
-DSSDocument
to be extendedparameters
-CAdESSignatureParameters
of the extension- Returns:
DSSDocument
a new extended document
-
extendCMSSignatures
Extends aCMS
- Parameters:
cms
-CMS
to extendparameters
-CAdESSignatureParameters
- Returns:
CMS
-
extendCMSSignatures
public CMS extendCMSSignatures(CMS cms, org.bouncycastle.cms.SignerInformation signerInformation, CAdESSignatureParameters parameters) Extends aCMS
with a specifiedSignerInformation
NOTE: does not modify otherSignerInformation
s- Parameters:
cms
-CMS
to extendsignerInformation
-SignerInformation
to extendparameters
-CAdESSignatureParameters
- Returns:
CMS
-
extendCMSSignatures
protected CMS extendCMSSignatures(CMS cms, Collection<org.bouncycastle.cms.SignerInformation> signerInformationsToExtend, CAdESSignatureParameters parameters) Loops on each signerInformation of thecmsSignedData
and extends ones defined in the collectionsignerInformationsToExtend
- Parameters:
cms
-CMS
signerInformationsToExtend
- a collection ofSignerInformation
to be extendedparameters
-CAdESSignatureParameters
for the extension- Returns:
CMS
with extended signerInformations
-
replaceSigners
protected CMS replaceSigners(CMS originalCMS, List<org.bouncycastle.cms.SignerInformation> newSignerInformationList) This method replaces the signers within the providedoriginalCMS
-
getTimeStampAttributeValue
protected org.bouncycastle.asn1.ASN1Object getTimeStampAttributeValue(DSSMessageDigest timestampMessageDigest, DigestAlgorithm timestampDigestAlgorithm, org.bouncycastle.asn1.cms.Attribute... attributesForTimestampToken) Generates and returns a TimeStamp attribute value- Parameters:
timestampMessageDigest
-DSSMessageDigest
message-digest to be timestampedtimestampDigestAlgorithm
-DigestAlgorithm
to useattributesForTimestampToken
-Attribute
s to add- Returns:
ASN1Object
representing a TimeStamp token attribute value
-
getDocumentValidator
This method returns a document validator for aCMS
- Parameters:
cms
-CMS
to get validation forparameters
-CAdESSignatureParameters
- Returns:
CMSDocumentAnalyzer
-