-
Bug
-
Resolution: Fixed
-
P3
-
5.0
-
b28
-
sparc
-
solaris_2.6
-
Verified
Name: ktR10099 Date: 10/15/2003
Calling method public void init(int, Key) with valid parameters of
NullCipher object results in NullPointerException. Please find example,
demonstrating the problem, below:
----------------------------test125.java--------------------------
import javax.crypto.*;
import javax.crypto.spec.*;
import java.security.*;
public class test125 {
public static void main(String[] args) {
NullCipher nc = new NullCipher();
byte[] b = {0, 1, 2, 3, 4, 5, 6, 7};
Key k = new SecretKeySpec(b, "DES");
try {
nc.init(Cipher.ENCRYPT_MODE, k);
System.out.println("Init successful");
} catch (Exception e) {
System.out.println("Unexpected exception " + e);
}
System.out.println("Finished");
}
}
-----------------------output of test125--------------------------
java full version "1.5.0-beta-b23"
Unexpected exception java.lang.NullPointerException
Finished
------------------------------------------------------------------
======================================================================