[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[iaik-jce] Signed S/MIME problem in MS Outlook



Hello

I use following code to send signed S/MIME emails. All work fine, only MS
Outlook (98) shows incorrect icon for message in inbox. Description of email
is valid ("Signed") but as icon is used "lock" in bottom right corner
instead "certficate" in top left corner. Any ideas...?

Thanks in advance

Ales Bukovsky, BSC Praha

Source code:


X509Certificate cert = loadCert();

System.out.println("Preparing SMTP session...");
Properties props = new Properties();
props.put("mail.smtp.host", HOST_SMTP);
Session session = Session.getDefaultInstance(props, null);

System.out.println("Preparing S/MIME message content...");
MimeBodyPart mbp = new SMimeBodyPart();
mbp.setText(MSG_BODY);
MimeBodyPart attach = new SMimeBodyPart();
attach.setDataHandler(new DataHandler(new FileDataSource(ATTACH_FILE)));
attach.setFileName(ATTACH_NAME);
Multipart mp = new SMimeMultipart();
mp.addBodyPart(mbp);
mp.addBodyPart(attach);

System.out.println("Preparing S/MIME message header...");
Message msg = new MimeMessage(session);
msg.setFrom(new InternetAddress(ADDRESS_FROM));
msg.setRecipients(javax.mail.Message.RecipientType.TO,
InternetAddress.parse(address, false));
msg.setSubject(MSG_SUBJECT);
msg.setSentDate(new java.util.Date());

System.out.println("Signing S/MIME message content...");
SignedContent sc = new SignedContent(SIGN_IMPLICIT);
sc.setDataHandler(new DataHandler(mp, mp.getContentType()));
sc.setCertificates(new X509Certificate[]{sstore.getCertificate()});
sc.setSigner(sstore.getPrivate(SECURE_STORE_PSWD), sstore.getCertificate());
sc.setHeaders(msg);
msg.setContent(sc, sc.getContentType());

System.out.println("Sending S/MIME message content...");
msg.saveChanges();
Transport.send(msg);
System.out.println("Session finished.");
--
Mailinglist-archive at http://jcewww.iaik.at/mailarchive/iaik-jce/jcethreads.html

To unsubscribe send an email to listserv@iaik.at with the folowing content: UNSUBSCRIBE iaik-jce