[Yanel-usage] Sending encrypted emails using OpenPGP

Michael Wechner michael.wechner at wyona.com
Fri Jan 31 15:52:31 CET 2014


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