-
Bug
-
Resolution: Not an Issue
-
P3
-
None
-
5.0
-
sparc
-
solaris_2.6
Name: ktR10099 Date: 10/17/2003
Attempt to retrieve original object from the SealedObject using
getObject(Cipher) method fails. Please find below example, demonstrating
the problem. It worth mentioning, that getObject(Key) method works OK.
---------------------------test126.java---------------------------
import javax.security.auth.kerberos.*;
import javax.crypto.*;
import javax.crypto.spec.*;
import java.security.*;
public class test126 {
public static void main(String[] args) {
Cipher c = null;
SealedObject so = null;
char[] passwd = new String("password").toCharArray();
KerberosPrincipal kp = new KerberosPrincipal("###@###.###");
Key k = new KerberosKey(kp, passwd, "DES");
try {
c = Cipher.getInstance("DES");
c.init(Cipher.ENCRYPT_MODE, k);
so = new SealedObject("Test string", c);
Object o = so.getObject(k);
System.out.println("Unsealed object : " + o);
} catch (Exception e) {
System.out.println("Unexpected exception : " + e);
}
try {
Object o = so.getObject(c);
System.out.println("Unsealed object : " + o);
} catch (Exception e) {
System.out.println("Unexpected exception : " + e);
}
System.out.println("Finished");
}
}
-------------------------test126 output---------------------------
java full version "1.5.0-beta-b23"
Unsealed object : Test string
Unexpected exception : java.io.StreamCorruptedException: invalid stream header
Finished
------------------------------------------------------------------
======================================================================