小编jul*_*ien的帖子

Java - 电子邮件签名

我在用 Java 签名电子邮件时遇到了一些问题。

我相信我的代码很好,但是当我在收件箱中收到电子邮件时,它说无法验证签名。

这里的代码 - 非常简单:

  boolean isAlias = false;

        // Add BouncyCastle content handlers to command map
        MailcapCommandMap mailcap = (MailcapCommandMap) CommandMap.getDefaultCommandMap();

        mailcap.addMailcap("application/pkcs7-signature;; x-java-content-handler=org.bouncycastle.superman.mail.smime.handlers.pkcs7_signature");
        mailcap.addMailcap("application/pkcs7-mime;; x-java-content-handler=org.bouncycastle.superman.mail.smime.handlers.pkcs7_mime");
        mailcap.addMailcap("application/x-pkcs7-signature;; x-java-content-handler=org.bouncycastle.superman.mail.smime.handlers.x_pkcs7_signature");
        mailcap.addMailcap("application/x-pkcs7-mime;; x-java-content-handler=org.bouncycastle.superman.mail.smime.handlers.x_pkcs7_mime");
        mailcap.addMailcap("multipart/signed;; x-java-content-handler=org.bouncycastle.superman.mail.smime.handlers.multipart_signed");

        CommandMap.setDefaultCommandMap(mailcap);

        Security.addProvider(new BouncyCastleProvider());

        KeyStore keyStore = KeyStore.getInstance("JKS");

        InputStream ins = SigningEmail.class.getResourceAsStream("/keystore.jks");

        // Provide location of Java Keystore and password for access
        keyStore.load(ins,"changeit".toCharArray());

        // Find the first legit alias in the keystore and use it
        Enumeration<String> es = keyStore.aliases();
        String alias = "";
        while (es.hasMoreElements()) {
            alias …
Run Code Online (Sandbox Code Playgroud)

java email signing jakarta-mail

5
推荐指数
1
解决办法
2624
查看次数

AWS RDS慢插入

我有一个关于在RDS中插入行的问题.我在该示例中插入301119记录在1表中.

在这里我登录那些插入批处理:

Amazon : 

2014-09-05 12:12:47,245 - Processing 30119 users 
2014-09-05 12:15:01,508 - 5000 users updated in transaction 
2014-09-05 12:17:29,672 - 10000 users updated in transaction 
2014-09-05 12:19:30,499 - 15000 users updated in transaction 
2014-09-05 12:21:38,866 - 20000 users updated in transaction 
2014-09-05 12:23:26,659 - 25000 users updated in transaction 
2014-09-05 12:25:16,727 - 30000 users updated in transaction 
2014-09-05 12:25:19,376 - 30119 users updated in transaction - DONE 
2014-09-05 12:25:19,379 - Process completed in **752134** ms 


Local : 

2014-09-05 12:33:20,767 …
Run Code Online (Sandbox Code Playgroud)

mysql bulkinsert amazon-web-services

2
推荐指数
1
解决办法
6376
查看次数