/** * Creates an <CODE>SMIMESignedGenerator</CODE>. Includes a signer private key and certificate, * and a pool of certs and cerls (if any) to go with the signature. * @return The generated SMIMESignedGenerator. */ public SMIMESignedGenerator createGenerator() throws CertStoreException, SMIMEException, OperatorCreationException, CertificateEncodingException { // create the generator for creating an smime/signed message SMIMESignedGenerator generator = new SMIMESignedGenerator(); // add a signer to the generator - this specifies we are using SHA1 // the encryption algorithm used is taken from the key SignerInfoGenerator signerInfoGenerator = new JcaSimpleSignerInfoGeneratorBuilder() .setProvider("BC") .build("SHA1withRSA", privateKey, certificate); generator.addSignerInfoGenerator(signerInfoGenerator); // add our pool of certs and cerls (if any) to go with the signature generator.addCertificates(jcaCertStore); return generator; }
certList.add(cer); Store<?> certs = new JcaCertStore(certList); signer.addCertificates(certs);
aSGen.addCertificates (aCertStore);
signer.addCertificates(bcerts);
throw new OxalisTransmissionException("Unable to create JcaCertStore with our certificate. " + e.getMessage(), e); smimeSignedGenerator.addCertificates(certs);
throw new OxalisTransmissionException("Unable to create JcaCertStore with our certificate. " + e.getMessage(), e); smimeSignedGenerator.addCertificates(certs);