It seems that I made some mistake... as usual... :)
I try to create a SignedAndEnvelopedDataStream with the code:
SignedAndEnvelopedDataStream saed = new
SignedAndEnvelopedDataStream(data_is, algoritmoDiCifratura);
where algoritmoDiCifratura is one of the following AlgortithmID:
des_EDE3_CBC
cast5_CBC
des_CBC
rc2_CBC
rc4
DES-based algorithms work fine, but with the others I get some errors:
when I use cast5_CBC the following error occurs:
----------------------------------------------------------
iaik.utils.InternalErrorException: Internal Key problem.
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Compiled Code)
at java.lang.RuntimeException.<init>(Compiled Code)
at iaik.utils.InternalErrorException.<init>(Compiled Code)
at
iaik.pkcs.pkcs7.EncryptedContentInfoStream.setupCipher(Compiled Code)
at iaik.pkcs.pkcs7.EnvelopedDataStream.<init>(Compiled Code)
at PKCS7File4.writeTo(Compiled Code)
at MyMessage4.sendCryptedToServer(Compiled Code)
at CryptingApplet10.action(Compiled Code)
at java.awt.Component.handleEvent(Compiled Code)
at java.awt.Component.postEvent(Compiled Code)
at java.awt.Component.postEvent(Compiled Code)
at java.awt.Component.postEvent(Compiled Code)
at java.awt.Component.postEvent(Compiled Code)
at java.awt.Component.dispatchEventImpl(Compiled Code)
at java.awt.Component.dispatchEvent(Compiled Code)
at java.awt.EventDispatchThread.run(Compiled Code)
Internal Key problem.
iaik.utils.InternalErrorException: Internal Key problem.
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Compiled Code)
at java.lang.RuntimeException.<init>(Compiled Code)
at iaik.utils.InternalErrorException.<init>(Compiled Code)
at
iaik.pkcs.pkcs7.EncryptedContentInfoStream.setupCipher(Compiled Code)
at iaik.pkcs.pkcs7.EnvelopedDataStream.<init>(Compiled Code)
at PKCS7File4.writeTo(Compiled Code)
at MyMessage4.sendCryptedToServer(Compiled Code)
at CryptingApplet10.action(Compiled Code)
at java.awt.Component.handleEvent(Compiled Code)
at java.awt.Component.postEvent(Compiled Code)
at java.awt.Component.postEvent(Compiled Code)
at java.awt.Component.postEvent(Compiled Code)
at java.awt.Component.postEvent(Compiled Code)
at java.awt.Component.dispatchEventImpl(Compiled Code)
at java.awt.Component.dispatchEvent(Compiled Code)
at java.awt.EventDispatchThread.run(Compiled Code)
-----------------------------------------------------------
with rc2_CBC:
----------------------------------------------------------
-1
java.lang.ArrayIndexOutOfBoundsException: -1
at iaik.security.cipher.i.a(Compiled Code)
at iaik.security.cipher.i.engineInit(Compiled Code)
at iaik.security.cipher.qb.engineInit(Compiled Code)
at javax.crypto.Cipher.init(Compiled Code)
at
iaik.pkcs.pkcs7.EncryptedContentInfoStream.setupCipher(Compiled Code)
at
iaik.pkcs.pkcs7.EncryptedContentInfoStream.setupCipher(Compiled Code)
at iaik.pkcs.pkcs7.EnvelopedDataStream.<init>(Compiled Code)
at PKCS7File4.writeTo(Compiled Code)
at MyMessage4.sendCryptedToServer(Compiled Code)
at CryptingApplet10.action(Compiled Code)
at java.awt.Component.handleEvent(Compiled Code)
at java.awt.Component.postEvent(Compiled Code)
at java.awt.Component.postEvent(Compiled Code)
at java.awt.Component.postEvent(Compiled Code)
at java.awt.Component.postEvent(Compiled Code)
at java.awt.Component.dispatchEventImpl(Compiled Code)
at java.awt.Component.dispatchEvent(Compiled Code)
at java.awt.EventDispatchThread.run(Compiled Code)
---------------------------------------------------------------
and with rc4 a similar error:
--------------------------------------------------------------
0
java.lang.ArrayIndexOutOfBoundsException: 0
at iaik.security.cipher.h.a(Compiled Code)
at iaik.security.cipher.h.engineInit(Compiled Code)
at iaik.security.cipher.qb.engineInit(Compiled Code)
at javax.crypto.Cipher.init(Compiled Code)
at
iaik.pkcs.pkcs7.EncryptedContentInfoStream.setupCipher(Compiled Code)
at
iaik.pkcs.pkcs7.EncryptedContentInfoStream.setupCipher(Compiled Code)
at iaik.pkcs.pkcs7.EnvelopedDataStream.<init>(Compiled Code)
at PKCS7File4.writeTo(Compiled Code)
at MyMessage4.sendCryptedToServer(Compiled Code)
at CryptingApplet10.action(Compiled Code)
at java.awt.Component.handleEvent(Compiled Code)
at java.awt.Component.postEvent(Compiled Code)
at java.awt.Component.postEvent(Compiled Code)
at java.awt.Component.postEvent(Compiled Code)
at java.awt.Component.postEvent(Compiled Code)
at java.awt.Component.dispatchEventImpl(Compiled Code)
at java.awt.Component.dispatchEvent(Compiled Code)
at java.awt.EventDispatchThread.run(Compiled Code)
------------------------------------------------------------------
Am I wrong if I try to use those algorithms?
Could you help me, please?
Thank you all,
Riccardo Conturbia
--
Mailinglist-archive at http://jcewww.iaik.tu-graz.ac.at/mailarchive/iaik-jce/maillist.html
To unsubscribe send an email to listserv@iaik.tu-graz.ac.at with the folowing content: UNSUBSCRIBE iaik-jce