• Post Reply Bookmark Topic Watch Topic
  • New Topic

Probs running code on AIX  RSS feed

 
Chinmay Bajikar
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I m trying to run my code on AIX and get this exception.

java.lang.SecurityException: Cannot authenticate JCE framework java.lang.SecurityException: The JCE framework has unsigned class files.
at com.sun.crypto.provider.SunJCE.a([DashoPro-V1.2-120198])
at com.sun.crypto.provider.SunJCE.c([DashoPro-V1.2-120198])
at com.sun.crypto.provider.DESCipher.<init>([DashoPro-V1.2-120198])
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:79)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:43)
at java.lang.reflect.Constructor.newInstance(Constructor.java:313)
at java.lang.Class.newInstance3(Class.java:363)
at java.lang.Class.newInstance(Class.java:301)
at javax.crypto.f.a(Unknown Source)
at javax.crypto.f.a(Unknown Source)
at javax.crypto.Cipher.getInstance(Unknown Source)
at bas.Encrypt.initEncrypt(Encrypt.java:93)

This is the code snippet that is causing issues,

Provider sunJce = new com.sun.crypto.provider.SunJCE();
Security.addProvider(sunJce);
SecretKeySpec skeySpec = new SecretKeySpec(raw, "DES");
try
{
// Instantiate the cipher
encCipher = Cipher.getInstance("DES");
encCipher.init(Cipher.ENCRYPT_MODE, skeySpec);
decCipher = Cipher.getInstance("DES");
decCipher.init(Cipher.DECRYPT_MODE, skeySpec);
}
catch(Exception e)
{
e.printStackTrace();
}

Please let me know as to where is the problem or if anybdy else has faced it before.My JVM is 1.4.1.

Thanks,
Chinmay
 
sander hautvast
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
did you manually change anything in the sunjce_provider.jar?
 
Chinmay Bajikar
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, I havent chnaged anything myself.
any directions for me to look at and evaluate?
 
Chinmay Bajikar
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sander,
I got it solved...
Added the following line to java.security file to pick up the proper IBM JCE classes.

security.provider.2=com.ibm.crypto.provider.IBMJCE

Thanks,
Chinmay....
[ July 15, 2004: Message edited by: Chinmay Bajikar ]
 
sander hautvast
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you should be able to use the sun jce though, as the architecture is meant to be pluggable.
 
Chinmay Bajikar
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sander,
You might be correct on that,but this is my understanding of ther JCE.
The java installation for the AIX (provided by IBM) doesnt bundle the JCE jars that are provided by Sun.(even though the hierarchy is the same).
The exception I was getting was that of the classes being unsigned.So basically the classes like Cipher are to being provided differently by Sun and IBM.By pushing that line in java.security we have allowed the program to use those classes (Cipher,etc) in a signed manner.

So in effect we are still using the Cryptography provider provided by Sun.

I may be wrong in what I have said above & if you think so,I will be glad to be corrected.

Thanks,
Chinmay....
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!