javamail-crypto-devel Mailing List for JavaMail Cryptography API
Status: Beta
Brought to you by:
akp
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
(1) |
Apr
(4) |
May
(1) |
Jun
(2) |
Jul
(2) |
Aug
|
Sep
|
Oct
(1) |
Nov
(5) |
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(3) |
Feb
(2) |
Mar
(13) |
Apr
(9) |
May
(1) |
Jun
(6) |
Jul
(3) |
Aug
(3) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2006 |
Jan
|
Feb
|
Mar
(7) |
Apr
(1) |
May
|
Jun
(7) |
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
(3) |
Mar
(1) |
Apr
(1) |
May
(2) |
Jun
(1) |
Jul
|
Aug
(5) |
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(4) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2014 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Mubashir <mub...@ya...> - 2014-08-22 13:14:05
|
Hi all, I facing an isuue while encrypting email with pgp encryption. I gets the class loder error about MimeMessage .. It some thing like "MimeMessage" is already loded with another name... I am using Bousycastel + javamail-crypto,,,,,,+tomcat Regards, |
From: Jethro T. <jet...@gm...> - 2014-02-25 02:55:15
|
I kept on having this error (java.security.NoSuchProviderException: No provider configured for S/MIME). I also included the following in my build path bcmail-jdk15on-150 bcprov-jdk15on-150 javamail-crypto_060622 javamail-crypto-bouncycastle-smime Any solutions on this? Thanks. |
From: Jan A. // C. A. <ja...@co...> - 2013-11-13 09:34:16
|
hi im hoping this list is for user help, not just developers of crypto? im new to all this certificate, encryption thing so I was of cause looking for something simple to use, just like this crypto library seams to be. but, im not sure if im "in the wrong place". The certificate of the reciever im trying to email is a X509v3 certificate they tell me and they tell me "so just use any solution that works with s/MIME". I tried to create a keystore with keytool, import the certificate and use it as in the example You have on the webpage for encrypting a email but it complains that its not a correct formattet stream. Is it because it cannot work with this kind of certificate or am I importing it wrong in the keystore or what am I missing You think? Regards Jan |
From: Sean L. <sea...@ic...> - 2012-08-09 17:06:36
|
Can anyone tell me if the call to sign the mime message actually takes all parts of the message into consideration? |
From: Phumlani M. | N. <phu...@na...> - 2012-02-09 13:02:15
|
Hi! :) Release 1.46 is broken(java 1.6 , 1.5, 1.4, 1.3 ), the issue is highlighted below. I used release 1.36 : http://www.apache.uasw.edu/pub/security/bouncycastle/release1.36/ , but it's not listed on your download page http://www.bouncycastle.org/latest_releases.html . Thanks. :) . From: Phumlani Mbabela | Native Sent: 09 February 2012 12:06 PM To: 'jav...@li...' Subject: RE: java.lang.NoSuchMethodError: org.bouncycastle.asn1.cms.AttributeTable.<init>(Lorg/bouncycastle/asn1/DEREncodableVector;)V Hi! org.bouncycastle.asn1.DEREncodableVector delete; org.bouncycastle.asn1.cms.AttributeTable delete1; delete = new DEREncodableVector(); delete1 = new AttributeTable(delete); // constructor not available. It looks like the jar's I have don't encompass the constructor AttributeTable(DEREncodableVector v ); What jars do I need if I want to use bouncy castle in Java 1.6 with JCE1.2.2? Thanks. From: Phumlani Mbabela | Native Sent: 09 February 2012 10:43 AM To: 'jav...@li...' Subject: java.lang.NoSuchMethodError: org.bouncycastle.asn1.cms.AttributeTable.<init>(Lorg/bouncycastle/asn1/DEREncodableVector;)V Importance: High Good morning I'm using Java 1.6 , JCE1.2.2 , and bouncy castle( bcmail-jdk16-146.jar and bcprov-jdk16-146.jar ) , I'm getting the following error when I'm signing(SMIME) an email message. This looks like a version compatibility issue. I can encrypt an email without any issues. What jars do I need if I want to use bouncy castle in Java 1.6 with JCE1.2.2? My current jars are bcmail-jdk16-146.jar bcprov-jdk16-146.jar jce1.2.2 .jar jdk1.6.0_29 [JDK] javamail-crypto-bouncycastle-smime.jar javamail-crypto.jar I have also noticed that "Bouncy Castle SMIME" is a jce1.2.1 implementation . "A clean room implementation of the JCE 1.2.1." http://www.bouncycastle.org/ Is this the issue? 0-(private key alias)'s COMODO CA Limited ID Exception in thread "main" java.lang.NoSuchMethodError: org.bouncycastle.asn1.cms.AttributeTable.<init>(Lorg/bouncycastle/asn1/DEREncodableVector;)V at net.suberic.crypto.bouncycastle.SMIMEEncryptionUtils.signMessage(SMIMEEncryptionUtils.java:267) at websec.org.encryption.mail.mime.EncryptMessage.configureAndSign(EncryptMessage.java:373) at websec.org.encryption.mail.mime.EncryptMessage.sign(EncryptMessage.java:141) at example.Example.main(Example.java:18) Java Result: 1 Thank you. Phumlani Mbabela | [tel] +27 (11) 555-3800 [cell] [fax] 0867210884 [email] phu...@na...<mailto:phu...@na...> Phumlani Mbabela | Software Engineer [tel] [cell] [fax] [email] phu...@na...<mailto:phu...@na...> [http://staging.brandsh01.com/native_stationary/NATIVE.gif] Website<http://www.native.co.za/> | <http://www.facebook.com/nativesa> Facebook<http://www.facebook.com/nativesa> | Twitter<http://twitter.com/nativespeak> | YouTube<http://www.youtube.com/nativewatch> | Flickr<http://www.flickr.com/photos/nativelook> For latest digital marketing news in your ears listen to the latest episode of The Digital Edge<http://www.thedigitaledge.co.za>, brought to you by NATIVE. This message may contain information, which is confidential, private or privileged in nature. If you are not the intended recipient of the message, you are notified that any distribution, use or copying of this message is prohibited. If you have received this message in error, please notify the sender immediately. [http://staging.brandsh01.com/native_stationary/rec_icon.gif] |
From: Phumlani M. | N. <phu...@na...> - 2012-02-09 10:06:48
|
Hi! org.bouncycastle.asn1.DEREncodableVector delete; org.bouncycastle.asn1.cms.AttributeTable delete1; delete = new DEREncodableVector(); delete1 = new AttributeTable(delete); // constructor not available. It looks like the jar's I have don't encompass the constructor AttributeTable(DEREncodableVector v ); What jars do I need if I want to use bouncy castle in Java 1.6 with JCE1.2.2? Thanks. From: Phumlani Mbabela | Native Sent: 09 February 2012 10:43 AM To: 'jav...@li...' Subject: java.lang.NoSuchMethodError: org.bouncycastle.asn1.cms.AttributeTable.<init>(Lorg/bouncycastle/asn1/DEREncodableVector;)V Importance: High Good morning I'm using Java 1.6 , JCE1.2.2 , and bouncy castle( bcmail-jdk16-146.jar and bcprov-jdk16-146.jar ) , I'm getting the following error when I'm signing(SMIME) an email message. This looks like a version compatibility issue. I can encrypt an email without any issues. What jars do I need if I want to use bouncy castle in Java 1.6 with JCE1.2.2? My current jars are bcmail-jdk16-146.jar bcprov-jdk16-146.jar jce1.2.2 .jar jdk1.6.0_29 [JDK] javamail-crypto-bouncycastle-smime.jar javamail-crypto.jar I have also noticed that "Bouncy Castle SMIME" is a jce1.2.1 implementation . "A clean room implementation of the JCE 1.2.1." http://www.bouncycastle.org/ Is this the issue? 0-(private key alias)'s COMODO CA Limited ID Exception in thread "main" java.lang.NoSuchMethodError: org.bouncycastle.asn1.cms.AttributeTable.<init>(Lorg/bouncycastle/asn1/DEREncodableVector;)V at net.suberic.crypto.bouncycastle.SMIMEEncryptionUtils.signMessage(SMIMEEncryptionUtils.java:267) at websec.org.encryption.mail.mime.EncryptMessage.configureAndSign(EncryptMessage.java:373) at websec.org.encryption.mail.mime.EncryptMessage.sign(EncryptMessage.java:141) at example.Example.main(Example.java:18) Java Result: 1 Thank you. Phumlani Mbabela | [tel] +27 (11) 555-3800 [cell] [fax] 0867210884 [email] phu...@na...<mailto:phu...@na...> Phumlani Mbabela | Software Engineer [tel] [cell] [fax] [email] phu...@na...<mailto:phu...@na...> [http://staging.brandsh01.com/native_stationary/NATIVE.gif] Website<http://www.native.co.za/> | <http://www.facebook.com/nativesa> Facebook<http://www.facebook.com/nativesa> | Twitter<http://twitter.com/nativespeak> | YouTube<http://www.youtube.com/nativewatch> | Flickr<http://www.flickr.com/photos/nativelook> For latest digital marketing news in your ears listen to the latest episode of The Digital Edge<http://www.thedigitaledge.co.za>, brought to you by NATIVE. This message may contain information, which is confidential, private or privileged in nature. If you are not the intended recipient of the message, you are notified that any distribution, use or copying of this message is prohibited. If you have received this message in error, please notify the sender immediately. [http://staging.brandsh01.com/native_stationary/rec_icon.gif] |
From: Phumlani M. | N. <phu...@na...> - 2012-02-09 08:56:17
|
Good morning I'm using Java 1.6 , JCE1.2.2 , and bouncy castle( bcmail-jdk16-146.jar and bcprov-jdk16-146.jar ) , I'm getting the following error when I'm signing(SMIME) an email message. This looks like a version compatibility issue. I can encrypt an email without any issues. What jars do I need if I want to use bouncy castle in Java 1.6 with JCE1.2.2? My current jars are bcmail-jdk16-146.jar bcprov-jdk16-146.jar jce1.2.2 .jar jdk1.6.0_29 [JDK] javamail-crypto-bouncycastle-smime.jar javamail-crypto.jar I have also noticed that "Bouncy Castle SMIME" is a jce1.2.1 implementation . "A clean room implementation of the JCE 1.2.1." http://www.bouncycastle.org/ Is this the issue? 0-(private key alias)'s COMODO CA Limited ID Exception in thread "main" java.lang.NoSuchMethodError: org.bouncycastle.asn1.cms.AttributeTable.<init>(Lorg/bouncycastle/asn1/DEREncodableVector;)V at net.suberic.crypto.bouncycastle.SMIMEEncryptionUtils.signMessage(SMIMEEncryptionUtils.java:267) at websec.org.encryption.mail.mime.EncryptMessage.configureAndSign(EncryptMessage.java:373) at websec.org.encryption.mail.mime.EncryptMessage.sign(EncryptMessage.java:141) at example.Example.main(Example.java:18) Java Result: 1 Thank you. Phumlani Mbabela | [tel] +27 (11) 555-3800 [cell] [fax] 0867210884 [email] phu...@na...<mailto:phu...@na...> Phumlani Mbabela | Software Engineer [tel] [cell] [fax] [email] phu...@na...<mailto:phu...@na...> [http://staging.brandsh01.com/native_stationary/NATIVE.gif] Website<http://www.native.co.za/> | <http://www.facebook.com/nativesa> Facebook<http://www.facebook.com/nativesa> | Twitter<http://twitter.com/nativespeak> | YouTube<http://www.youtube.com/nativewatch> | Flickr<http://www.flickr.com/photos/nativelook> For latest digital marketing news in your ears listen to the latest episode of The Digital Edge<http://www.thedigitaledge.co.za>, brought to you by NATIVE. This message may contain information, which is confidential, private or privileged in nature. If you are not the intended recipient of the message, you are notified that any distribution, use or copying of this message is prohibited. If you have received this message in error, please notify the sender immediately. [http://staging.brandsh01.com/native_stationary/rec_icon.gif] |
From: Lee, D. [USA] <lee...@ba...> - 2011-07-25 22:11:30
|
Good afternoon! My team is currently in the process of using JavaMail-Crypto API to sign and encrypt e-mails on a government classified system and cannot proceed with using JavaMail-Crypto API because BouncyCastle is not FIPS-140 certified. However, we have FIPS-140-2 certified NSS libraries compiled in Java and would like to write a hook to extend the EncryptionManager to use NSS as a crypto provider. Has anyone done this or thought of doing this before? Would anyone be able to offer any guidance on this approach and steps that I would have to take to do this? Your help would be very much appretiated! Thank you in advance for your help, Danny Lee Booz | Allen | Hamilton One Preserve Parkway, Suite 200 Rockville, MD 20852 USA Mobile.412.779.7058 lee...@ba...<mailto:lee...@ba...> |
From: allen p. <al...@su...> - 2011-05-30 21:35:57
|
Hi. Sorry--the SMIME support in the javamail-crypto API requires that the keys be stored in a PKCS#12 format. I don't think that there's an actual technical requirement for that, though. In theory you could write a provider that took something in PKCS#11 format and use it. Anyway--the code from the SMIMEEncryptionKeyManager is just BouncySMIMEEncryptionKey ek = new BouncySMIMEEncryptionKey(); Certificate[] chain = privateKeyStore.getCertificateChain(alias); ek.setCertificateChain(chain); PrivateKey privKey = (PrivateKey)privateKeyStore.getKey(alias, password); ek.setDisplayAlias(alias); ek.setKey(privKey); return ek; So if you can get the key and Certificate chain from your token with the code Pavan sent, then you can create a BouncySMIMEEncryptionKey and then pass it in. That should work, even if it's a bit more hacky than it should be. -allen On Fri, May 27, 2011, 11:48, Victor Sterpu <vi...@ca...> wrote >I tried. >I can succesfully compile, but at run time the error is: > >java.lang.ClassCastException: sun.security.pkcs11.P11Key$P11PrivateKey >cannot be cast to net.suberic.crypto.bouncycastle.BouncySMIMEEncryptionKey > at >net.suberic.crypto.bouncycastle.SMIMEEncryptionUtils.signMessage(SMIMEEncry ptionUtils.java:248) > at signmessage.signmessage.main(signmessage.java:98) > > >On 27.05.2011 15:52, pavankumar wrote: >> Victor, >> >> I don't know how to replace this line >> smimeKeyMgr.loadPrivateKeystore(new >> FileInputStream(new File("./id.p12")), smimePw); >> >> smimeKeyMgr is used to get the privateKey in the next step. >> >> so try below code to get the *PrivateKey*.. this will serve your purpose >> >> >> // get the certificate >> X509Certificate cert =(X509Certificate) >> ks.getCertificate(certificateAlias); >> >> // get the private key from the keystore. >> PrivateKey privateKey = (PrivateKey) >> ks.getKey(certificateAlias,privateKeyPass.toCharArray()); >> >> Hope this helps. >> *_ >> _* >> */_Pavan Kumar Reddy K __/* >> *Manage**Engine *| *Z**O**H**O* Dev Center - India >> /www.zoho.com <https://www.zoho.com/>, www.manageengine.com >> <http://www.manageengine.com/>./ >> */ >> /* >> */This message is for the designated recipient only and may contain >> privileged, proprietary, or otherwise private information. If you have >> received it in error, please notify the sender immediately and delete >> the original. Any other use of the email by you is prohibited./* >> / >> / >> /* >> */ >> /*Save Paper, Save Trees*./ >> /Please consider your environmental responsibility before printing >> this e-mail./ >> >> >> ---- On Fri, 27 May 2011 16:41:55 +0530 *Victor Sterpu >> <vi...@ca... <mailto:vi...@ca...>>* wrote ---- >> >> Can I sign SMIME a message using a PKCS11 token? >> I have started from this example >> http://javamail-crypto.sourceforge.net/examples/SignMessage.java. >> I don't know how to replace this line >> smimeKeyMgr.loadPrivateKeystore(new FileInputStream(new >> File("./id.p12")), smimePw); >> With something that includes my private key from the token. >> >> I know the private key from PKCS11 can't be extracted. >> This is my code for accesing the token. >> >> KeyStore keystorePkcs11; >> keystorePkcs11 = KeyStore.getInstance("pkcs11"); >> keystorePkcs11.load(null, PASSWORD_PKCS11); >> Enumeration aliasesEnum = keystorePkcs11.aliases(); >> String alias = (String) aliasesEnum.nextElement(); >> X509Certificate cert = (X509Certificate) >> keystorePkcs11.getCertificate(alias); >> Key key = keystorePkcs11.getKey(alias, null); >> PrivateKey smimeKey = (PrivateKey) key; >> >> Thank you >> >> ---------------------------------------------------------------------------- -- >> >> vRanger cuts backup time in half-while increasing security. >> With the market-leading solution for virtual backup and recovery, >> you get blazing-fast, flexible, and affordable data protection. >> Download your free trial now. >> http://p.sf.net/sfu/quest-d2dcopy1 >> _______________________________________________ >> Javamail-crypto-devel mailing list >> Jav...@li... >> <mailto:Jav...@li...> >> https://lists.sourceforge.net/lists/listinfo/javamail-crypto-devel >> >> > > |
From: Victor S. <vi...@ca...> - 2011-05-27 15:42:25
|
I tried. I can succesfully compile, but at run time the error is: java.lang.ClassCastException: sun.security.pkcs11.P11Key$P11PrivateKey cannot be cast to net.suberic.crypto.bouncycastle.BouncySMIMEEncryptionKey at net.suberic.crypto.bouncycastle.SMIMEEncryptionUtils.signMessage(SMIMEEncryptionUtils.java:248) at signmessage.signmessage.main(signmessage.java:98) On 27.05.2011 15:52, pavankumar wrote: > Victor, > > I don't know how to replace this line > smimeKeyMgr.loadPrivateKeystore(new > FileInputStream(new File("./id.p12")), smimePw); > > smimeKeyMgr is used to get the privateKey in the next step. > > so try below code to get the *PrivateKey*.. this will serve your purpose > > > // get the certificate > X509Certificate cert =(X509Certificate) > ks.getCertificate(certificateAlias); > > // get the private key from the keystore. > PrivateKey privateKey = (PrivateKey) > ks.getKey(certificateAlias,privateKeyPass.toCharArray()); > > Hope this helps. > *_ > _* > */_Pavan Kumar Reddy K __/* > *Manage**Engine *| *Z**O**H**O* Dev Center - India > /www.zoho.com <https://www.zoho.com/>, www.manageengine.com > <http://www.manageengine.com/>./ > */ > /* > */This message is for the designated recipient only and may contain > privileged, proprietary, or otherwise private information. If you have > received it in error, please notify the sender immediately and delete > the original. Any other use of the email by you is prohibited./* > / > / > /* > */ > /*Save Paper, Save Trees*./ > /Please consider your environmental responsibility before printing > this e-mail./ > > > ---- On Fri, 27 May 2011 16:41:55 +0530 *Victor Sterpu > <vi...@ca... <mailto:vi...@ca...>>* wrote ---- > > Can I sign SMIME a message using a PKCS11 token? > I have started from this example > http://javamail-crypto.sourceforge.net/examples/SignMessage.java. > I don't know how to replace this line > smimeKeyMgr.loadPrivateKeystore(new FileInputStream(new > File("./id.p12")), smimePw); > With something that includes my private key from the token. > > I know the private key from PKCS11 can't be extracted. > This is my code for accesing the token. > > KeyStore keystorePkcs11; > keystorePkcs11 = KeyStore.getInstance("pkcs11"); > keystorePkcs11.load(null, PASSWORD_PKCS11); > Enumeration aliasesEnum = keystorePkcs11.aliases(); > String alias = (String) aliasesEnum.nextElement(); > X509Certificate cert = (X509Certificate) > keystorePkcs11.getCertificate(alias); > Key key = keystorePkcs11.getKey(alias, null); > PrivateKey smimeKey = (PrivateKey) key; > > Thank you > > ------------------------------------------------------------------------------ > > vRanger cuts backup time in half-while increasing security. > With the market-leading solution for virtual backup and recovery, > you get blazing-fast, flexible, and affordable data protection. > Download your free trial now. > http://p.sf.net/sfu/quest-d2dcopy1 > _______________________________________________ > Javamail-crypto-devel mailing list > Jav...@li... > <mailto:Jav...@li...> > https://lists.sourceforge.net/lists/listinfo/javamail-crypto-devel > > |
From: Victor S. <vi...@ca...> - 2011-05-27 11:14:12
|
Can I sign SMIME a message using a PKCS11 token? I have started from this example http://javamail-crypto.sourceforge.net/examples/SignMessage.java. I don't know how to replace this line smimeKeyMgr.loadPrivateKeystore(new FileInputStream(new File("./id.p12")), smimePw); With something that includes my private key from the token. I know the private key from PKCS11 can't be extracted. This is my code for accesing the token. KeyStore keystorePkcs11; keystorePkcs11 = KeyStore.getInstance("pkcs11"); keystorePkcs11.load(null, PASSWORD_PKCS11); Enumeration aliasesEnum = keystorePkcs11.aliases(); String alias = (String) aliasesEnum.nextElement(); X509Certificate cert = (X509Certificate) keystorePkcs11.getCertificate(alias); Key key = keystorePkcs11.getKey(alias, null); PrivateKey smimeKey = (PrivateKey) key; Thank you |
From: Tomas V. <tom...@se...> - 2009-10-29 20:22:10
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=UTF-8" http-equiv="Content-Type"> </head> <body bgcolor="#ffffff" text="#000000"> Hello,<br> I have problem with signing multipart mail. If I try send simple signed mail it is delivered and Thunderbird says its signed and correct. But if I send multipart mail it is delivered but Thunderbird says the mail was signed but the signature doesn't match the content. Where's problem? Is it possible to sign multipart mail?<br> <br> Code that does sending:<br> public void test() throws MessagingException {<br> Properties props = new Properties();<br> Session session = Session.getInstance(props);<br> MimeMessage msg = new MimeMessage(session);<br> msg.setFrom(new InternetAddress(<a class="moz-txt-link-rfc2396E" href="mailto:te...@se...">"te...@se..."</a>));<br> msg.setRecipient(Message.RecipientType.TO, new InternetAddress(<a class="moz-txt-link-rfc2396E" href="mailto:tom...@se...">"tom...@se..."</a>));<br> msg.setSubject("Testovaci podepsany mail");<br> <br> // create and fill the first message part<br> MimeBodyPart mbp1 = new MimeBodyPart();<br> mbp1.setText("Text testovaciho podepsaneho mailu");<br> msg.setContent("Testovaci podepsany mail", "text/plain");<br> <br> // create the second message part<br> MimeBodyPart mbp2 = new MimeBodyPart();<br> <br> // attach the file to the message<br> FileDataSource fds = new FileDataSource(new File("oracle_prereq.sh"));<br> mbp2.setDataHandler(new DataHandler(fds));<br> mbp2.setFileName(fds.getName());<br> <br> // create the Multipart and add its parts to it<br> Multipart mp = new MimeMultipart();<br> mp.addBodyPart(mbp1);<br> mp.addBodyPart(mbp2);<br> <br> // add the Multipart to the message<br> msg.setContent(mp);<br> <br> // set the Date: header<br> msg.setSentDate(new Date());<br> msg.saveChanges();<br> <br> msg = signMessage(msg, session);<br> <br> Transport transport = session.getTransport("smtp");<br> transport.connect("smtp.server", null, null);<br> <br> transport.sendMessage(msg, msg.getAllRecipients());<br> }<br> <br> protected MimeMessage signMessage(MimeMessage mimeMessage, Session session) throws MailException {<br> try {<br> // Getting of the S/MIME EncryptionUtilities.<br> EncryptionUtils encUtils = EncryptionManager.getEncryptionUtils(EncryptionManager.SMIME);<br> <br> // Loading of the S/MIME keystore from the file (stored as resource).<br> char[] keystorePass = getCertificatePassword().toCharArray();<br> EncryptionKeyManager encKeyManager = encUtils.createKeyManager();<br> encKeyManager.loadPrivateKeystore(getClass().getResourceAsStream("aaa.p12"), keystorePass);<br> <br> // Getting of the S/MIME private key for signing.<br> Key privateKey = encKeyManager.getPrivateKey(getPrivateKeyAlias(), keystorePass);<br> <br> // Signing the message.<br> return encUtils.signMessage(session, mimeMessage, privateKey);<br> } catch (Exception e) {<br> throw new MailPreparationException(e);<br> }<br> }<br> <br> private String getPrivateKeyAlias() {<br> return "alias";<br> }<br> <br> private String getCertificatePassword() {<br> return "password";<br> }<br> <br> Thanks <br> TV<br> </body> </html> |
From: Didac <um...@gm...> - 2009-07-22 10:35:01
|
Sorry, my english is not really good. What I mean is that I only want to extract the certificates from the signed message (from the smime.p7s body part). ¿How I can do this with javamail-crypto? Then I want to check if the certificate is valid for my CA (I have it on a X509TrustManager). 2009/7/22 Didac <um...@gm...> > I'm ussing java for verify the signature, so the cacerts are on > $JAVA_HOME/lib/security/cacerts. I have the CA installed and I sing a > message with a private key that is signed by this CA. > It's easy to extrac the public key associated to a signed message > (EncryptionUtils extractkeys method). Then, what I need is to check if this > key is signed by my CA. With this I can check the validity of the signature. > > 2009/7/22 <geo...@fi...> > > You can attach the public key to the mail. It is quite simple. But for >> checking against a CA, you would need the CA keys. They usually exists >> within the OS but I have no idea where. >> >> >> >> Best Regards >> >> Phone Norway: 02367 abroad: +47 974 14 025 >> Fileflow Technologies AS >> Ole Deviks vei 35, 0668 Oslo, Norway >> >> ------------------------------------- >> >> >> >> >> >> >> >> On 21 Jul 2009, at 23:19, Didac wrote: >> >> Hi everyone! >>> >>> I'm ussing javamail-crypto with S/MIME provider based off of the >>> BouncyCastle. I sends mail signed and I can verify the sign correctly if I >>> have it. >>> >>> But the default way to verify a signatura (Outlook does it) is sending >>> the public key or the certificate with the signed message. So, the receiver >>> can download the certificate and veritfy the signature with the public key >>> on the certificate. It's possible to do with javamail-crypto? >>> >>> Another thing that can by done is to verify if the message is signed with >>> a private key signed by a CA. It's possible? (Thunderbird does it) >>> >>> Regards >>> >>> >>> ------------------------------------------------------------------------------ >>> _______________________________________________ >>> Javamail-crypto-devel mailing list >>> Jav...@li... >>> https://lists.sourceforge.net/lists/listinfo/javamail-crypto-devel >>> >> >> > |
From: Didac <um...@gm...> - 2009-07-22 09:30:01
|
I'm ussing java for verify the signature, so the cacerts are on $JAVA_HOME/lib/security/cacerts. I have the CA installed and I sing a message with a private key that is signed by this CA. It's easy to extrac the public key associated to a signed message (EncryptionUtils extractkeys method). Then, what I need is to check if this key is signed by my CA. With this I can check the validity of the signature. 2009/7/22 <geo...@fi...> > You can attach the public key to the mail. It is quite simple. But for > checking against a CA, you would need the CA keys. They usually exists > within the OS but I have no idea where. > > > > Best Regards > > Phone Norway: 02367 abroad: +47 974 14 025 > Fileflow Technologies AS > Ole Deviks vei 35, 0668 Oslo, Norway > > ------------------------------------- > > > > > > > > On 21 Jul 2009, at 23:19, Didac wrote: > > Hi everyone! >> >> I'm ussing javamail-crypto with S/MIME provider based off of the >> BouncyCastle. I sends mail signed and I can verify the sign correctly if I >> have it. >> >> But the default way to verify a signatura (Outlook does it) is sending the >> public key or the certificate with the signed message. So, the receiver can >> download the certificate and veritfy the signature with the public key on >> the certificate. It's possible to do with javamail-crypto? >> >> Another thing that can by done is to verify if the message is signed with >> a private key signed by a CA. It's possible? (Thunderbird does it) >> >> Regards >> >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> Javamail-crypto-devel mailing list >> Jav...@li... >> https://lists.sourceforge.net/lists/listinfo/javamail-crypto-devel >> > > |
From: <geo...@fi...> - 2009-07-22 06:37:20
|
You can attach the public key to the mail. It is quite simple. But for checking against a CA, you would need the CA keys. They usually exists within the OS but I have no idea where. Best Regards Phone Norway: 02367 abroad: +47 974 14 025 Fileflow Technologies AS Ole Deviks vei 35, 0668 Oslo, Norway ------------------------------------- On 21 Jul 2009, at 23:19, Didac wrote: > Hi everyone! > > I'm ussing javamail-crypto with S/MIME provider based off of the > BouncyCastle. I sends mail signed and I can verify the sign > correctly if I have it. > > But the default way to verify a signatura (Outlook does it) is > sending the public key or the certificate with the signed message. > So, the receiver can download the certificate and veritfy the > signature with the public key on the certificate. It's possible to > do with javamail-crypto? > > Another thing that can by done is to verify if the message is signed > with a private key signed by a CA. It's possible? (Thunderbird does > it) > > Regards > > ------------------------------------------------------------------------------ > _______________________________________________ > Javamail-crypto-devel mailing list > Jav...@li... > https://lists.sourceforge.net/lists/listinfo/javamail-crypto-devel |
From: Didac <um...@gm...> - 2009-07-21 21:19:47
|
Hi everyone! I'm ussing javamail-crypto with S/MIME provider based off of the BouncyCastle. I sends mail signed and I can verify the sign correctly if I have it. But the default way to verify a signatura (Outlook does it) is sending the public key or the certificate with the signed message. So, the receiver can download the certificate and veritfy the signature with the public key on the certificate. It's possible to do with javamail-crypto? Another thing that can by done is to verify if the message is signed with a private key signed by a CA. It's possible? (Thunderbird does it) Regards |
From: allen p. <al...@su...> - 2008-06-25 20:26:05
|
Hi. Huh. Sounds like Outlook 2003 is doing something a little bit strange with S/MIME signed and encrypted mail. But I don't know off the top of my head what that might be. Let me see if I can dredge up a copy of that to test with and see if I can reproduce the problem. -allen On Tue, Jun 24, 2008, 09:05, WeST <we...@in...> wrote >hi everybody, >i'm rookie to JavaMail-Crypto, so excuse my potencial stupid questions. >i'm working on java application that processes incoming emails and then calls >other systems with obtained data. communication with partners who are sending emails >can be secured by encryption and/or signature. i have generated test emails from >outlook 2003. so far i'm able to read free, signed and encrypted emails. problem is >with encrypted signed email. after decrypting i got MimeMessage with content type >"text/plain" and content as BASE64DecoderStream. i've tried something like >http://osdir.com/ml/encryption.bouncy-castle.devel/2006-10/msg00151.html >but extra bytes remain and i'm still not able to verify signature nor get signatured >message. >any suggestions? > >environment: >websphere 6.0.2.15 (java 1.4.2) >bcmail-jdk14-139.jar >bcprov-jdk14-139.jar >javamail-crypto_060622.jar >javamail-crypto-bouncycastle-smime_060622.jar > >thanks a lot, >miroslav > |
From: Vijay V. <sha...@gm...> - 2008-04-17 20:24:29
|
We've been running our enterprise application in a 32-bit JVM for about 8 years now. Due to load related issues which result in increased transient memory usage, we are considering moving to a 64-bit JVM. I am unable to find any documentation related to using javamail-crypto in a 64 bit environment and whether it is supported in any way. Is anyone using javamail-crypto in a 64 bit production environment? Are there any known issues? If so, what are they and are there workarounds? Is there any information published about using javamail-crypto in a 64-bit JVM? Thanks, Vijay |
From: Ben A. <ben...@st...> - 2007-06-25 10:26:06
|
Hello there I would greatly appreciate a small amount of your time to assist with my doctoral research at The University of Newcastle. The research concerns open source licensing and we're seeking developers working on Java projects. The research is supervised, ethics-approved, anonymous and results will be freely available. Participation will also provide a custom licensing report for your project. To learn more, please visit: http://licensing-research.newcastle.edu.au Thanks for reading this email, and I hope you'll consider participating. Best regards Ben Alex (My apologies for being off-topic; this list will not be emailed again) |
From: allen p. <al...@su...> - 2007-05-25 15:22:02
|
Hi. The javamail-crypto library is, at least for now, just a high-level API for handling encryption and signing of emails. While it does have some key-management features, it is not meant to be a general-purpose encryption API. That having been said, in the case of PGP, I use gnupg to manage my PGP keys. You can use the gnupg pubring.gpg as the public keystore for javamail-crypto. If you have a public keyring created, and someone sends you an email containing their PGP public key, you can use javamail-crypto to import said key into your public keystore. It goes something like EncryptionUtils utils = EncryptionManager.getEncryptionUtils(message); Key[] extractedKeys = utils.extractKeys(message); for (int i = 0; i < extractedKeys.length; i++) { net.suberic.crypto.EncryptionKey eKey = (net.suberic.crypto.EncryptionKey) extractedKeys[i]; publicKeyStore.setPublicKeyEntry(eKey.getDisplayAlias(), eKey); } I don't have a way to load the keys just from straight text files. You can either use external tools, or you could just use the Cryptix or BouncyCastle APIs directly for that. I get the feeling that that would be a good feature to add into the API. -allen On Tue, May 22, 2007, 15:21, Warren Goldman <War...@so...> wrote >The example shows (at http://javamail-crypto.sourceforge.net/); > > > > pgpKeyMgr.loadPublicKeystore(new FileInputStream(new File("./alice.pkr")), null); > > > >How do I create the alice.pkr or where is documentation that tells me how? > > > >I need to encrypt a message (using someone elses public key). I do not need to decrypt. So I am assuming my pkr would only need an entry > >for that persons public key > > > >Furthermore, how do I get the other person's public key into my pkr so that I may encrypt the message? > > > >The following link talks about it, but it looks like I need some client side app (pgp) to import the public key. > >http://www.ephesus.com/Encryption/RetrieveKeys.html > > > >Help is appreciated. > > |
From: Warren G. <War...@so...> - 2007-05-22 19:21:46
|
The example shows (at http://javamail-crypto.sourceforge.net/); =20 pgpKeyMgr.loadPublicKeystore(new FileInputStream(new = File("./alice.pkr")), null); =20 How do I create the alice.pkr or where is documentation that tells me = how? =20 I need to encrypt a message (using someone elses public key). I do not = need to decrypt. So I am assuming my pkr would only need an entry for that persons public key =20 Furthermore, how do I get the other person's public key into my pkr so = that I may encrypt the message? =20 The following link talks about it, but it looks like I need some client = side app (pgp) to import the public key. http://www.ephesus.com/Encryption/RetrieveKeys.html =20 Help is appreciated. |
From: graillat G. <gra...@am...> - 2007-04-30 17:30:37
|
Oh yes, that's sure. |
From: allen p. <al...@su...> - 2007-03-01 04:38:15
|
Hi. You need to run against the keyring file, not the exported key. Try=20 pubring.gpg and secring.gpg. -allen On Wed, Feb 28, 2007, 05:22, x x <cc...@wp...> wrote >Hello. >I have this error while trying to run encrypt message example. > >java.security.cert.CertificateException: Error while reading keyring -=20 cryptix.pki.KeyBundleException: cryptix.openpgp.PGPFatalDataFormatException= :=20 Invalid packet type. >=09at=20 cryptix.openpgp.provider.PGPKeyRingKeyStore.engineLoad(PGPKeyRingKeyStore.j= a va:398) >=09at java.security.KeyStore.load(Unknown Source) >=09at=20 net.suberic.crypto.cryptix.CryptixKeyManager.loadPublicKeystore(CryptixKeyM= a nager.java:63) >=09at=20 net.suberic.crypto.examples.EncryptMessage.main(EncryptMessage.java:52) > >the line 52 is: > >pgpKeyMgr.loadPublicKeystore(new FileInputStream(new=20 File("c:/majkers.pkr")), null); > >and it is content of majkers.pkr file: > >-----BEGIN PGP PUBLIC KEY BLOCK----- >Version: 2.6 > >mQCPA0XgVZgBigEEAJ8HFZbIvX88powtzr/KAnNw9xjYksRMrYbprrZ+FOK31oUV >KbRPo1n6pUz1JR0AyMENuPWnKYznj74XYinsBZowC/fFu9eHJ38tUGPkBhMD1mZA >B7ByLuV0EdGKtxHLI1UH/mRFy0akIAYU0ytpfwYfZObXzZ1vK9n1GKoDv41DABEB >AAG0F21hamtlcnMgPG1hamtlcnNAbzIucGw+iQCVAwUQReBVmNn1GKoDv41DAQHb >RwP9Eois+XUap4fiV+7juCNz0MVzv+F96suh9swsn2n+EUzdtU5xhHH+lnY+CRvz >aXman8ib3Jm9ZPq1e4NmmI8SEPNvBR42GadXVVfGFU9os720sYrYYqoOARlD5ZFa >JmQyZHiJz+JfL/U/wOH69TrO7hrjAwHrL52SUoxoGnyV2vQ=3D >=3D+xtk >-----END PGP PUBLIC KEY BLOCK----- > > >so what is wrong??? please help :/ > >---------------------------------------------------- >Zobaczcie, jak jedno marzenie mo?e zmieni? wszystko.=20 >Zdobywca trzech Z?otych Glob=F3w i o?miu nominacji do Oscara=20 >- musical "Dreamgirls" w kinach ju? od 2 marca. >http://klik.wp.pl/?adr=3Dhttp%3A%2F%2Fadv.reklama.wp.pl%2Fas%2Fcos111.html= &si d=3D1040 > > > >------------------------------------------------------------------------- >Take Surveys. Earn Cash. Influence the Future of IT >Join SourceForge.net's Techsay panel and you'll get the chance to share=20 your >opinions on IT & business topics through brief surveys-and earn cash >http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3DD= EVDEV >_______________________________________________ >Javamail-crypto-devel mailing list >Jav...@li... >https://lists.sourceforge.net/lists/listinfo/javamail-crypto-devel > > |
From: x x <cc...@wp...> - 2007-02-28 10:22:53
|
Hello. I have this error while trying to run encrypt message example. java.security.cert.CertificateException: Error while reading keyring - cryptix.pki.KeyBundleException: cryptix.openpgp.PGPFatalDataFormatException: Invalid packet type. at cryptix.openpgp.provider.PGPKeyRingKeyStore.engineLoad(PGPKeyRingKeyStore.java:398) at java.security.KeyStore.load(Unknown Source) at net.suberic.crypto.cryptix.CryptixKeyManager.loadPublicKeystore(CryptixKeyManager.java:63) at net.suberic.crypto.examples.EncryptMessage.main(EncryptMessage.java:52) the line 52 is: pgpKeyMgr.loadPublicKeystore(new FileInputStream(new File("c:/majkers.pkr")), null); and it is content of majkers.pkr file: -----BEGIN PGP PUBLIC KEY BLOCK----- Version: 2.6 mQCPA0XgVZgBigEEAJ8HFZbIvX88powtzr/KAnNw9xjYksRMrYbprrZ+FOK31oUV KbRPo1n6pUz1JR0AyMENuPWnKYznj74XYinsBZowC/fFu9eHJ38tUGPkBhMD1mZA B7ByLuV0EdGKtxHLI1UH/mRFy0akIAYU0ytpfwYfZObXzZ1vK9n1GKoDv41DABEB AAG0F21hamtlcnMgPG1hamtlcnNAbzIucGw+iQCVAwUQReBVmNn1GKoDv41DAQHb RwP9Eois+XUap4fiV+7juCNz0MVzv+F96suh9swsn2n+EUzdtU5xhHH+lnY+CRvz aXman8ib3Jm9ZPq1e4NmmI8SEPNvBR42GadXVVfGFU9os720sYrYYqoOARlD5ZFa JmQyZHiJz+JfL/U/wOH69TrO7hrjAwHrL52SUoxoGnyV2vQ= =+xtk -----END PGP PUBLIC KEY BLOCK----- so what is wrong??? please help :/ ---------------------------------------------------- Zobaczcie, jak jedno marzenie może zmienić wszystko. Zdobywca trzech Złotych Globów i ośmiu nominacji do Oscara - musical "Dreamgirls" w kinach już od 2 marca. http://klik.wp.pl/?adr=http%3A%2F%2Fadv.reklama.wp.pl%2Fas%2Fcos111.html&sid=1040 |
From: allen p. <al...@su...> - 2007-02-23 05:52:56
|
On Thu, Feb 22, 2007, 10:32, x x <cc...@wp...> wrote >Hi. Hi. >I'am rookie user of JavaMail-Crypto so I hve some questions: >1. Can I store pgp keys and smime sertificates in JCE keystore files (keytool)? JavaMail-Crypto uses native storage formats for OpenPGP and S/MIME. So OpenPGP keys are expected to be in public and secure keyrings, and S/MIME certificates are expected to be in PKCS#12 files. You might be able to use keytool to access those; I don't know. >2. How can simply create pgp keys or smime certificates? BEcause You only use them btu is there any simple way to create them? Not using any CA organisation. I usually use gpg to create PGP keys and openssl to create self-signed S/MIME certificates. gpg is really easy to use (gpg --gen-key); the process for S/MIME certs, even self-signed ones, is a bit more (unnecessarily) complex. You should be able to google instructions for that, though. (I feel like I had instructions on that around here, but I can't seem to find them.....) -allen > >---------------------------------------------------- >Matt Damon, Angelina Jolie, William Hurt, Robert de Niro >i Alec Baldwin w prawdziwej histori ktora zna tylko tylko >jeden cz?owiek. DOBRY AGENT - w kinach od 23 lutego! >http://klik.wp.pl/?adr=http%3A%2F%2Fadv.reklama.wp.pl%2Fas%2Fdobryagent.htm l&sid=1024 > > > >------------------------------------------------------------------------- >Take Surveys. Earn Cash. Influence the Future of IT >Join SourceForge.net's Techsay panel and you'll get the chance to share your >opinions on IT & business topics through brief surveys-and earn cash >http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV >_______________________________________________ >Javamail-crypto-devel mailing list >Jav...@li... >https://lists.sourceforge.net/lists/listinfo/javamail-crypto-devel > > |