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.*
and

import javax.mail.internet.* #
and

MimeMessage and Multipart. #.
However with

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

HtmlEmail email = new HtmlEmail();
  email.setHostName("localhost");
  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",
       EmailAttachment.ATTACHMENT);
  email.send();

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.