本文整理汇总了Java中org.bouncycastle.mail.smime.SMIMEException类的典型用法代码示例。如果您正苦于以下问题:Java SMIMEException类的具体用法?Java SMIMEException怎么用?Java SMIMEException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SMIMEException类属于org.bouncycastle.mail.smime包,在下文中一共展示了SMIMEException类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: processHTMLBodyWithBASE64Images
import org.bouncycastle.mail.smime.SMIMEException; //导入依赖的package包/类
private void processHTMLBodyWithBASE64Images(MimeMultipart multipart) throws ParserException,
MessagingException, NoSuchAlgorithmException, SMIMEException, java.security.NoSuchProviderException {
if (null != body && body.contains("base64")) {
Parser parser = new Parser(body);
NodeList nodeList = parser.parse(null);
HtmlImageNodeVisitor htmlImageNodeVisitor = new HtmlImageNodeVisitor();
nodeList.visitAllNodesWith(htmlImageNodeVisitor);
body = nodeList.toHtml();
addAllBase64ImagesToMimeMultipart(multipart, htmlImageNodeVisitor.getBase64Images());
}
}
开发者ID:CloudSlang,项目名称:cs-actions,代码行数:13,代码来源:SendMail.java
示例2: addAllBase64ImagesToMimeMultipart
import org.bouncycastle.mail.smime.SMIMEException; //导入依赖的package包/类
private void addAllBase64ImagesToMimeMultipart(MimeMultipart multipart, Map<String, String> base64ImagesMap)
throws MessagingException, NoSuchAlgorithmException, NoSuchProviderException, SMIMEException {
for (String contentId : base64ImagesMap.keySet()) {
MimeBodyPart imagePart = getImageMimeBodyPart(base64ImagesMap, contentId);
imagePart = encryptMimeBodyPart(imagePart);
multipart.addBodyPart(imagePart);
}
}
开发者ID:CloudSlang,项目名称:cs-actions,代码行数:9,代码来源:SendMail.java
示例3: encryptMimeBodyPart
import org.bouncycastle.mail.smime.SMIMEException; //导入依赖的package包/类
private MimeBodyPart encryptMimeBodyPart(MimeBodyPart mimeBodyPart) throws NoSuchAlgorithmException,
NoSuchProviderException, SMIMEException {
if (encryptMessage) {
mimeBodyPart = gen.generate(mimeBodyPart, encryptionOID, BOUNCY_CASTLE_PROVIDER);
}
return mimeBodyPart;
}
开发者ID:CloudSlang,项目名称:cs-actions,代码行数:8,代码来源:SendMail.java
示例4: decode2Mime
import org.bouncycastle.mail.smime.SMIMEException; //导入依赖的package包/类
private MimeBodyPart decode2Mime(InputStream body) throws MessagingException, CMSException, SMIMEException, IOException {
StringBuilder builder = new StringBuilder();
builder.append("Content-Disposition: attachment; filename=\"smime.p7m\"\r\n");
builder.append("Content-Type: application/pkcs7-mime; smime-type=enveloped-data; name=\"smime.p7m\"\r\n");
builder.append("Content-Transfer-Encoding: base64\r\n\r\n");
ByteArrayInputStream is = new ByteArrayInputStream(builder.toString().getBytes("utf-8"));
MimeBodyPart mp = new MimeBodyPart(new SequenceInputStream(is, body));
return decode2Mime(mp);
}
开发者ID:gini,项目名称:jersey-smime,代码行数:10,代码来源:EnvelopedTest.java
注:本文中的org.bouncycastle.mail.smime.SMIMEException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论