Example usage for org.bouncycastle.mail.smime SMIMESignedGenerator addSigners

List of usage examples for org.bouncycastle.mail.smime SMIMESignedGenerator addSigners

Introduction

In this page you can find the example usage for org.bouncycastle.mail.smime SMIMESignedGenerator addSigners.

Prototype

public void addSigners(SignerInformationStore signerStore) 

Source Link

Document

Add a store of precalculated signers to the generator.

Usage

From source file:org.votingsystem.signature.smime.SMIMEMessage.java

License:Open Source License

private void replaceSigners(CMSSignedData cmsdata) throws Exception {
    log.info("replaceSigners");
    SMIMESignedGenerator gen = new SMIMESignedGenerator();
    gen.addAttributeCertificates(cmsdata.getAttributeCertificates());
    gen.addCertificates(cmsdata.getCertificates());
    gen.addSigners(cmsdata.getSignerInfos());
    MimeMultipart mimeMultipart = gen.generate(smimeSigned.getContent(),
            smimeSigned.getContent().getFileName());
    setContent(mimeMultipart, mimeMultipart.getContentType());
    saveChanges();/*w  ww  . ja v  a  2s .  c  om*/
}