[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[iaik-jce] IAIK
Hello,
I'm working with iaik.pkcs.pkcs7.EnvelopedDataStream class.
I'm working with this code:
InputStream is = ........
(*) AlgorithmID algID = AlgorithmID.rc4;
EnvelopedDataStream enveloped_data = new EnvelopedDataStream(is, algID);
but this exception throws:
java.lang.ArrayIndexOutOfBoundsException: 0
at iaik.security.cipher.g.a(Unknown Source)
at iaik.security.cipher.g.engineInit(Unknown Source)
at iaik.security.cipher.v.engineInit(Unknown Source)
at javax.crypto.Cipher.init(Unknown Source)
at iaik.pkcs.pkcs7.EncryptedContentInfoStream.setupCipher(Unknown
Source)
at iaik.pkcs.pkcs7.EncryptedContentInfoStream.setupCipher(Unknown
Source)
................................................
I have not requirements for particular key/parameter handling, so I want
automatically create a symmetric key for content encryption and
setup the cipher with above code.
This exception happens also with AlgorithmID.rc2_CBC.
I tried this code with AlgorithmID.des_CBC and it works fine.
I tried this code with an AlgorithmID object
created by using the constructor
public AlgorithmID(String objectID, String name, String
implementationName);
for IDEA CBC (implementation is IDEA/CBC/PKCS5Padding)
and it works fine;
Because my application should allow an user to use a specified cipher
chosen (from user) in a set of available ciphers (DES, 3DES, RC2, RC4 ,
IDEA, CAST5..)
I'm wondering if I can to use in a trasparent way (from these ciphers)
EnvelopDataStream class.
Thanks (also for previous answers) ,
Vito
--
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