Hi everybody! I´ve used jdk to generate my certificate with the following command:

keytool -genkey -keyalg RSA -alias certificatekey -keystore keystore.jks -storepass password -validity 360 -keysize 2048
Everything works fine when I want to digitally sign an e-mail using:

import javax.mail.*

import javax.mail.internet.* #

MimeMessage and Multipart. #.
However with

Apache Commons Email 1.1
creating an email such as the following:

HtmlEmail email = new HtmlEmail();
  email.addTo("test@mail.com", "Test");
  email.setFrom("testapp@mail.com", "Test App");
  email.setSubject("Test message");
  email.setHtmlMsg("<div style='font-size: 20px; color: green;'>This is html email</div>");
  email.attach(new ByteArrayDataSource(pdfBytes, "application/pdf"),
      "document.pdf", "Document description",

Is it possible to digitally sign this e-mail ?

I really appreciate your help!

Best Regards

this post on the Oracle blogs might shed some light on it