我想知道为什么第一个结果与第二个结果不同?
完整代码:
public static void main throws Exception
{
KeyGenerator kg = KeyGenerator.getInstance("RC2");
SecretKey sk = kg.generateKey();
byte[] key = sk.getEncoded();
System.out.println(Arrays.toString(key));
System.out.println("****");
SecretKey sk1 = new SecretKeySpec(key, kg.getAlgorithm());
boolean status = sk1.equals(sk);
System.out.println(status); //the result is true
System.out.println(sk1==sk); //the result is false
}