[prev in list] [next in list] [prev in thread] [next in thread] 

List:       bouncycastle-crypto-dev
Subject:    [dev-crypto] How to encrypt email which has multiple recipients ?
From:       nancy <nancyrathinam () gmail ! com>
Date:       2013-09-25 12:08:22
Message-ID: 1380110902176-4656432.post () n4 ! nabble ! com
[Download RAW message or body]


I am using bouncy-castle for achieving SMIME (Public key encryption). To
send an encrypted email to multiple recipients I chose this method

   1. Encrypt the email with the random key

   2. Encrypt the random key with each recipients public key and set it to
the MIME message. If there are three recipients in the email , the object
will have three encrypted random key.

   3. Recipients will identify the suitable encrypted random key, decrypt it
using their private key and decrypt the content with the help of the random
key.

What bouncy-castle class should I use to encrypt a message with random
string. I know below code can be used to encrypt a msg using recipient's
certificate.

/* Create the encrypter */
SMIMEEnvelopedGenerator encrypter = new SMIMEEnvelopedGenerator();
encrypter.addKeyTransRecipient((X509Certificate) certChain[0]);

/* Encrypt the MimeMessage*/
MimeBodyPart encryptedPart = encrypter.generate(signedMessage,
SMIMEEnvelopedGenerator.RC2_CBC, "BC");

Can some one post me the code to encrypt a MimeMessage with random key in
bouncy-castle?




--
View this message in context: \
http://bouncy-castle.1462172.n4.nabble.com/How-to-encrypt-email-which-has-multiple-recipients-tp4656432.html
 Sent from the Bouncy Castle - Dev mailing list archive at Nabble.com.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic