Creating a Cerificate for Bouncy Castle Encryption
- by Gordon
I am trying to create a self-signed certificate to use for encrypting an email using bouncycaste.
What would be the best way to generate a certificate?
I have tried using openssl but I have had problems with certificate.
Here is the code I am using to encrypt, I am using 3des.
SMIMEEnvelopedGenerator gen = new SMIMEEnvelopedGenerator();
gen.addKeyTransRecipient(x509Cert); // adds an X509Certificate
MimeBodyPart encData =
gen.generate(mimeBodyPart, SMIMEEnvelopedGenerator.DES_EDE3_CBC, "BC");