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
Modifier and TypeFieldDescriptionprotected final CertificateVerifier
The CertificateVerifier to useprotected final TSPSource
The TSPSource to request a timestamp (T- and LTA-levels) -
Constructor Summary
ConstructorDescriptionCAdESLevelBaselineLT
(TSPSource tspSource, CertificateVerifier certificateVerifier) The default constructor. -
Method Summary
Modifier and TypeMethodDescriptionorg.bouncycastle.cms.CMSSignedData
extendCMSSignatures
(org.bouncycastle.cms.CMSSignedData cmsSignedData, CAdESSignatureParameters parameters) Extends aCMSSignedData
protected org.bouncycastle.cms.CMSSignedData
extendCMSSignatures
(org.bouncycastle.cms.CMSSignedData cmsSignedData, CAdESSignatureParameters parameters, List<String> signatureIdsToExtend) This method extends the signatures in thecmsSignedData
with ids listed withinsignatureIdsToExtend
protected org.bouncycastle.cms.CMSSignedData
extendCMSSignatures
(org.bouncycastle.cms.CMSSignedData cmsSignedData, Collection<org.bouncycastle.cms.SignerInformation> signerInformationsToExtend, CAdESSignatureParameters parameters) Loops on each signerInformation of thecmsSignedData
and extends ones defined in the collectionsignerInformationsToExtend
org.bouncycastle.cms.CMSSignedData
extendCMSSignatures
(org.bouncycastle.cms.CMSSignedData cmsSignedData, org.bouncycastle.cms.SignerInformation signerInformation, CAdESSignatureParameters parameters) Extends aCMSSignedData
with a specifiedSignerInformation
NOTE: does not modify otherSignerInformation
sextendSignatures
(DSSDocument signatureToExtend, CAdESSignatureParameters parameters) Extends the level of the signatures contained in a document.protected CMSDocumentValidator
getDocumentValidator
(org.bouncycastle.cms.CMSSignedData signedData, CAdESSignatureParameters parameters) This method returns a document validator for aCMSSignedData
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
(org.bouncycastle.cms.CMSSignedData cmsSignedData) Verifies if the CMSSignedData contains an ATSTv2protected CAdESSignature
newCAdESSignature
(org.bouncycastle.cms.CMSSignedData cmsSignedData, org.bouncycastle.cms.SignerInformation signerInformation, List<DSSDocument> detachedContents) Creates a CAdESSignature.protected org.bouncycastle.cms.CMSSignedData
replaceSigners
(org.bouncycastle.cms.CMSSignedData cmsSignedData, List<org.bouncycastle.cms.SignerInformation> newSignerInformationList) This method replaces the signers within the providedcmsSignedData
-
Field Details
-
tspSource
The TSPSource to request a timestamp (T- and LTA-levels) -
certificateVerifier
The CertificateVerifier to use
-
-
Constructor Details
-
CAdESLevelBaselineLT
The default constructor.- Parameters:
tspSource
-TSPSource
for a timestamp creationcertificateVerifier
-CertificateVerifier
-
-
Method Details
-
extendCMSSignatures
protected org.bouncycastle.cms.CMSSignedData extendCMSSignatures(org.bouncycastle.cms.CMSSignedData cmsSignedData, CAdESSignatureParameters parameters, List<String> signatureIdsToExtend) This method extends the signatures in thecmsSignedData
with ids listed withinsignatureIdsToExtend
- Overrides:
extendCMSSignatures
in classCAdESLevelBaselineT
- Parameters:
cmsSignedData
-CMSSignedData
containing the signatures to be extendedparameters
-CAdESSignatureParameters
signatureIdsToExtend
- a list ofString
signature Ids to be extended- Returns:
CMSSignedData
-
includesATSv2
protected boolean includesATSv2(org.bouncycastle.cms.CMSSignedData cmsSignedData) Verifies if the CMSSignedData contains an ATSTv2- Parameters:
cmsSignedData
-CMSSignedData
to check- Returns:
- TRUE if the
cmsSignedData
contains an ATSTv2, FALSE otherwise
-
extendSignatures
public CMSSignedDocument extendSignatures(DSSDocument signatureToExtend, CAdESSignatureParameters parameters) Description copied from interface:SignatureExtension
Extends the level of the signatures contained in a document.- Specified by:
extendSignatures
in interfaceSignatureExtension<CAdESSignatureParameters>
- Parameters:
signatureToExtend
-DSSDocument
to be extendedparameters
-CAdESSignatureParameters
of the extension- Returns:
CMSSignedDocument
a new extended document
-
extendCMSSignatures
public org.bouncycastle.cms.CMSSignedData extendCMSSignatures(org.bouncycastle.cms.CMSSignedData cmsSignedData, CAdESSignatureParameters parameters) Extends aCMSSignedData
- Parameters:
cmsSignedData
-CMSSignedData
to extendparameters
-CAdESSignatureParameters
- Returns:
CMSSignedData
-
extendCMSSignatures
public org.bouncycastle.cms.CMSSignedData extendCMSSignatures(org.bouncycastle.cms.CMSSignedData cmsSignedData, org.bouncycastle.cms.SignerInformation signerInformation, CAdESSignatureParameters parameters) Extends aCMSSignedData
with a specifiedSignerInformation
NOTE: does not modify otherSignerInformation
s- Parameters:
cmsSignedData
-CMSSignedData
to extendsignerInformation
-SignerInformation
to extendparameters
-CAdESSignatureParameters
- Returns:
CMSSignedData
-
extendCMSSignatures
protected org.bouncycastle.cms.CMSSignedData extendCMSSignatures(org.bouncycastle.cms.CMSSignedData cmsSignedData, Collection<org.bouncycastle.cms.SignerInformation> signerInformationsToExtend, CAdESSignatureParameters parameters) Loops on each signerInformation of thecmsSignedData
and extends ones defined in the collectionsignerInformationsToExtend
- Parameters:
cmsSignedData
-CMSSignedData
signerInformationsToExtend
- a collection ofSignerInformation
to be extendedparameters
-CAdESSignatureParameters
for the extension- Returns:
CMSSignedData
with extended signerInformations
-
replaceSigners
protected org.bouncycastle.cms.CMSSignedData replaceSigners(org.bouncycastle.cms.CMSSignedData cmsSignedData, List<org.bouncycastle.cms.SignerInformation> newSignerInformationList) This method replaces the signers within the providedcmsSignedData
- Parameters:
cmsSignedData
-CMSSignedData
to replace SignerInformations withinnewSignerInformationList
- a list of newSignerInformation
s- Returns:
CMSSignedData
-
newCAdESSignature
protected CAdESSignature newCAdESSignature(org.bouncycastle.cms.CMSSignedData cmsSignedData, org.bouncycastle.cms.SignerInformation signerInformation, List<DSSDocument> detachedContents) Creates a CAdESSignature. Note: recommended method to use.- Parameters:
cmsSignedData
-CMSSignedData
of a signature to createsignerInformation
-SignerInformation
detachedContents
- a list of detachedDSSDocument
s- Returns:
- created
CAdESSignature
-
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
protected CMSDocumentValidator getDocumentValidator(org.bouncycastle.cms.CMSSignedData signedData, CAdESSignatureParameters parameters) This method returns a document validator for aCMSSignedData
- Parameters:
signedData
-CMSSignedData
to get validation forparameters
-CAdESSignatureParameters
- Returns:
CMSDocumentValidator
-