[Yanel-usage] [Yanel-dev] Using S/MIME [WAS: Re: Sending encrypted emails using OpenPGP

Michael Wechner michael.wechner at wyona.com
Tue Feb 4 22:53:57 CET 2014


Please note that we have encryption only implemented and not signing the
message.

In order to implement the signing of a message the following
documents/examples probably help:

http://stackoverflow.com/questions/12299884/bouncycastle-encrypt-mail-with-smime-and-x-509
http://www.docjar.org/src/api/org/bouncycastle/mail/smime/examples/CreateSignedMail.java

Thanks

Michael

Am 04.02.14 09:38, schrieb Michael Wechner:
> Hi
>
> We have enhanced Yanel, such that one can send encrypted emails using
> S/MIME as well
>
> recipient.setSMIMECertificate(smimeCertificateString);
>
> whereas smimeCertificateString is something like
>
> -----BEGIN CERTIFICATE-----
> MIIFMzC.....
> ....Fo6yzdtU0lTsCVGDcp
> -----END CERTIFICATE-----
>
> Thanks
>
> Michael
>
> Am 31.01.14 15:52, schrieb Michael Wechner:
>> Hi
>>
>> We have enhanced Yanel, such that one can send encrypted emails using
>> OpenPGP:
>>
>> import org.wyona.yanel.core.util.Recipient;
>>
>> Recipient recipient = new Recipient(toEmail);
>> recipient.setPGPPublicKey(pgpPublicKeyString);
>>
>> whereas pgpPublicKeyString is something like
>>
>> -----BEGIN PGP PUBLIC KEY BLOCK-----
>> Version: GnuPG/MacGPG2 v2.0.22 (Darwin)
>> Comment: GPGTools - https://gpgtools.org
>>
>> mQENBFKA6HkBCADpsp+I........
>> ......
>> NR+INtInp0nEssXtOaXA/PBIHp3wb2BiqhetINanGIG+pJpFhLDFuA0O+xFSc2Dg
>> ne12XDY=
>> =jxDH
>> -----END PGP PUBLIC KEY BLOCK-----
>>
>> and then one can send it with
>>
>> MailUtil.send(fromEmail, null, recipient, subject, body);
>>
>> and then the MailUtil will encrypt the message accordingly.
>>
>> Thanks
>>
>> Michael



More information about the Yanel-usage mailing list