|
From: Robert E. <re...@ix...> - 2005-12-29 20:41:07
|
btw, this is with the Cryptix JCE snapshot.
-----Original Message-----
From: Robert Engels [mailto:re...@ix...]
Sent: Thursday, December 29, 2005 2:40 PM
To: cry...@li...
Subject: getEncoded() fails with RSA Keys
Using getEncoded() on keys returned Cryptix KeyPair factory does not work.
The It throws a ClassNotFoundException looking for the MPIOutputStream
which is not included in the provider jar (the source is included in the
distribution though).
KeyPairGenerator kpg =
KeyPairGenerator.getInstance("RSA","CryptixCrypto");
kpg.initialize(1024);
KeyPair pair = kpg.generateKeyPair();
publicKey = pair.getPublic();
privateKey = pair.getPrivate();
I think it is because the above code returns instances of
RSAPublicKeyCryptix rather than RSAPublicKeyImpl.
Even if the class was encluded, it does not seem to be valid anyway, since
getEncoded() should probably write the key using the ASN format always (at
least according to the API).
The "Sun" provider returns keys where getEncoded() returns the X509
format.
|