Class CMSSignedDataBuilder


  • public class CMSSignedDataBuilder
    extends Object
    • Method Summary

      Modifier and Type Method Description
      protected org.bouncycastle.cms.CMSSignedDataGenerator createCMSSignedDataGenerator​(CAdESSignatureParameters parameters, org.bouncycastle.operator.ContentSigner contentSigner, org.bouncycastle.cms.SignerInfoGeneratorBuilder signerInfoGeneratorBuilder, org.bouncycastle.cms.CMSSignedData originalSignedData)
      Note: Section 5.1 of RFC 3852 [4] requires that, the CMS SignedData version be set to 3 if certificates from SignedData is present AND (any version 1 attribute certificates are present OR any SignerInfo structures are version 3 OR eContentType from encapContentInfo is other than id-data).
      org.bouncycastle.cms.CMSSignedData extendCMSSignedData​(org.bouncycastle.cms.CMSSignedData cmsSignedData, org.bouncycastle.cms.SignerInformation signerInformation, List<DSSDocument> detachedContents)
      Extends the provided cmsSignedData with the required validation data
      protected org.bouncycastle.cms.CMSSignedData regenerateCMSSignedData​(org.bouncycastle.cms.CMSSignedData cmsSignedData, List<DSSDocument> detachedContents, org.bouncycastle.util.Store certificatesStore, org.bouncycastle.util.Store attributeCertificatesStore, org.bouncycastle.util.Store crlsStore, org.bouncycastle.util.Store otherRevocationInfoFormatStoreBasic, org.bouncycastle.util.Store otherRevocationInfoFormatStoreOcsp)  
    • Constructor Detail

      • CMSSignedDataBuilder

        public CMSSignedDataBuilder​(CertificateVerifier certificateVerifier)
        This is the default constructor for CMSSignedDataGeneratorBuilder. The CertificateVerifier is used to find the trusted certificates.
        Parameters:
        certificateVerifier - CertificateVerifier provides information on the sources to be used in the validation process in the context of a signature.
    • Method Detail

      • createCMSSignedDataGenerator

        protected org.bouncycastle.cms.CMSSignedDataGenerator createCMSSignedDataGenerator​(CAdESSignatureParameters parameters,
                                                                                           org.bouncycastle.operator.ContentSigner contentSigner,
                                                                                           org.bouncycastle.cms.SignerInfoGeneratorBuilder signerInfoGeneratorBuilder,
                                                                                           org.bouncycastle.cms.CMSSignedData originalSignedData)
                                                                                    throws DSSException
        Note: Section 5.1 of RFC 3852 [4] requires that, the CMS SignedData version be set to 3 if certificates from SignedData is present AND (any version 1 attribute certificates are present OR any SignerInfo structures are version 3 OR eContentType from encapContentInfo is other than id-data). Otherwise, the CMS SignedData version is required to be set to 1. CMS SignedData Version is handled automatically by BouncyCastle.
        Parameters:
        parameters - set of the driving signing parameters
        contentSigner - the contentSigner to get the hash of the data to be signed
        signerInfoGeneratorBuilder - the builder for the signer info generator
        originalSignedData - the original signed data if extending an existing signature. null otherwise.
        Returns:
        the bouncycastle signed data generator which signs the document and adds the required signed and unsigned CMS attributes
        Throws:
        DSSException
      • regenerateCMSSignedData

        protected org.bouncycastle.cms.CMSSignedData regenerateCMSSignedData​(org.bouncycastle.cms.CMSSignedData cmsSignedData,
                                                                             List<DSSDocument> detachedContents,
                                                                             org.bouncycastle.util.Store certificatesStore,
                                                                             org.bouncycastle.util.Store attributeCertificatesStore,
                                                                             org.bouncycastle.util.Store crlsStore,
                                                                             org.bouncycastle.util.Store otherRevocationInfoFormatStoreBasic,
                                                                             org.bouncycastle.util.Store otherRevocationInfoFormatStoreOcsp)
      • extendCMSSignedData

        public org.bouncycastle.cms.CMSSignedData extendCMSSignedData​(org.bouncycastle.cms.CMSSignedData cmsSignedData,
                                                                      org.bouncycastle.cms.SignerInformation signerInformation,
                                                                      List<DSSDocument> detachedContents)
        Extends the provided cmsSignedData with the required validation data
        Parameters:
        cmsSignedData - CMSSignedData to be extended
        signerInformation - the related SignerInformation to use
        detachedContents - list of detached DSSDocuments
        Returns:
        extended CMSSignedData