Setting timezone
package org.webdocwf.util.smime.smime;
public void enveloping(String algorithmName, int
keyLength) throws SMIMEException {
SimpleTimeZone tz = (SimpleTimeZone)
SimpleTimeZone.getDefault(); // Sets date and time
changing to
TimeZone tz = (TimeZone) SimpleTimeZone.getDefault
(); // Sets date and time
If we don't do this, we got error :
C:\j2sdk1.4.2_05\bin\java -Didea.launcher.port=7532 -
Didea.launcher.library=C:\IntelliJ-IDEA-4.5
\bin\breakgen.dll -Dfile.encoding=windows-1252 -
classpath C:\j2sdk1.4.2_05
\jre\lib\charsets.jar;C:\j2sdk1.4.2_05
\jre\lib\jce.jar;C:\j2sdk1.4.2_05
\jre\lib\jsse.jar;C:\j2sdk1.4.2_05
\jre\lib\plugin.jar;C:\j2sdk1.4.2_05
\jre\lib\rt.jar;C:\j2sdk1.4.2_05
\jre\lib\sunrsasign.jar;C:\j2sdk1.4.2_05
\jre\lib\ext\dnsns.jar;C:\j2sdk1.4.2_05
\jre\lib\ext\ldapsec.jar;C:\j2sdk1.4.2_05
\jre\lib\ext\localedata.jar;C:\j2sdk1.4.2_05
\jre\lib\ext\sunjce_provider.jar;C:\javaClasses;P:\java\so
urcesSECUREMAIL\lib\lib\commons-
logging.jar;P:\java\sourcesSECUREMAIL\lib\lib\dnsjava.jar
;P:\java\sourcesSECUREMAIL\lib\lib\jes-
1.3.4.jar;P:\java\sourcesSECUREMAIL\lib\lib\log4j.jar;P:\j
ava\sourcesSECUREMAIL\lib\activation.jar;P:\java\source
sSECUREMAIL\lib\bcmail-jdk14-
123.jar;P:\java\sourcesSECUREMAIL\lib\bcprov-jdk14-
123.jar;P:\java\sourcesSECUREMAIL\lib\jcjarmaster.jar;P:
\java\sourcesSECUREMAIL\lib\junit.jar;P:\java\sourcesSE
CUREMAIL\lib\junitpp-
3.8.1.jar;P:\java\sourcesSECUREMAIL\lib\mail.jar;P:\java\
sourcesSECUREMAIL\lib\jtidy-04aug2000r6
\build\Tidy.jar;C:\IntelliJ-IDEA-4.5\lib\idea_rt.jar
com.intellij.rt.execution.application.AppMain
org.webdocwf.util.smime.test.TestEncrypt hastings
geert
P:\java\sourcesSECUREMAIL\certs\recipient512.cer 3DES
Creating the encrypted message with DES_EDE3_CBC
algorithm...
java.lang.ClassCastException
at
org.webdocwf.util.smime.smime.EnvelopedSMIME.envelopi
ng(EnvelopedSMIME.java:644)
at
org.webdocwf.util.smime.test.TestEncrypt.main
(TestEncrypt.java:102)
at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke
(Method.java:324)
at
com.intellij.rt.execution.application.AppMain.main
(AppMain.java:78)
SMIME Error 1999: Caused by non SMIMEException!
null
java.lang.Exception captured in enveloping method of
org.webdocwf.util.smime.smime.EnvelopedSMIME class
and thrown as SMIMEException.
SMIMEException rised in instance of the class:
org.webdocwf.util.smime.smime.EnvelopedSMIME
Process finished with exit code 0