From: Reinout van Schouwen <reinout@gm...> - 2005-11-18 10:49:57
[Since the moderation queue of this list doesn't seem to be watched,
I've subscribed and I'm resending this mail. Apologies if it did turn up
I suspect I've found a bug in Jython the latest Jython alpha release. (If
it's not, someone please explain me what I'm misunderstanding..)
What I'm trying to do is to compare two public keys. Since there's no
equals() in the PublicKey interface, I wanted to use Arrays.equals on the
encoded keys. The method getEncoded() returns a byte array representing
the public key.
>>> from java.security import KeyPairGenerator from java.util import
>>> kp = KeyPairGenerator.getInstance("DSA").generateKeyPair()
>>> Arrays.equals([1,2,3], [1,2,3])
>>> Arrays.equals([2,2,1], [1,2,3])
( so far, so good...)
Executed from BeanShell, the same call on Arrays.equals() returns true.
Does anyone know what's going on?
Reinout van Schouwen