title: java.security.NoSuchProviderException: No provider configured for S/MIME
body: <p>I've been trying to solve my problem but I couldn't u_u</p>
  
  <p>Well, let's see. I need to send an email (which I can do) but the last requirement was that I needed to attach a certificate (SSL) and that was the problem. This is my code:</p>
  
  <pre><code>        // @param _smimePw         keystore password = "techbrainwave"
      // @param _alias         keystore password = "certificatekey"
  
      // get the S/MIME EncryptionUtilities
      ##EncryptionUtils smimeUtils = EncryptionManager.getEncryptionUtils(EncryptionManager.SMIME);##
  
      // load the S/MIME keystore from the given file.
      char[] smimePw = new String("techbrainwave").toCharArray();
      EncryptionKeyManager smimeKeyMgr = smimeUtils.createKeyManager();
      smimeKeyMgr.loadPrivateKeystore(new FileInputStream(new File("C:\\j2sdk1.4.2_18\\bin\\truststore.jks")), smimePw);
  
      // get our keys.
      java.security.Key smimeKey = smimeKeyMgr.getPrivateKey("certificatekey", smimePw);
  
      msg.setContent(parts);
  
      // write smime message.
      MimeMessage smimeSignedMsg = smimeUtils.signMessage(mailSession, msg, smimeKey);
      Transport tr = mailSession.getTransport("smtp");
      tr.connect(SMTPServer, "", "");
      smimeSignedMsg.saveChanges(); // don't forget this
      tr.sendMessage(smimeSignedMsg, smimeSignedMsg.getAllRecipients());
      tr.close();
  </code></pre>
  
  <p>The line that is marked is where the following exception brings my code down:</p>
  
  <blockquote>
    <p>java.security.NoSuchProviderException: No provider configured for S/MIME
        at net.suberic.crypto.EncryptionManager.getEncryptionUtils(EncryptionManager.java:99)</p>
  </blockquote>
  
  <p>I took the example from this link:</p>
  
  <p><a href="http://blog.jservlet.com/post/2008/01/03/How-to-use-Javamail-Crypto-with-S/MIME-provider?pub=0#pr" rel="nofollow">http://blog.jservlet.com/post/2008/01/03/How-to-use-Javamail-Crypto-with-S/MIME-provider?pub=0#pr</a></p>
  
  <p>I hope you can help me please. I have two days with this problem and I don't know where the problem is. What I try to do is to attach a SSL certificate to my mail that is the resume of my problem. If there's another way to solve it I'll be grateful to see it.</p>
  
  <p>Thanks in advance.</p>
  
  <p>Regards.</p>