That's very weird. According to the JDK javadoc, there should be a
default iniitalization:
In case the client does not explicitly initialize the KeyPairGenerator
(via a call to an initialize method), each provider must supply (and
document) a default initialization. For example, the Sun provider uses a
default modulus size (keysize) of 1024 bits.
Perhaps this is happening because the generator is using a Random object
rather than a SecureRandom object. Random seeds itself using the current
time, which for two subsequent calls, may be the same.
Please check in your fix, and thanks for catching this!
Sameer
> Hi all,
>
> Anyone seen this before:
>
> (I've got my default KeyPairGenerator Provider to be
> sun.security.provider.Sun)
>
> All my KeyPairs being generated are the same (equal) ...
>
> Try this:
>
> KeyPair kp1 = jsdsi.RSAPublicKey.create("RSA");
> KeyPair kp2 = jsdsi.RSAPublicKey.create("RSA");
>
> System.out.println( kp1.getPublic().toString() );
> System.out.println( kp2.getPublic().toString() );
>
>
> (I've found that if I insert a call to initialise(KEY_SIZE) in the
> jsdsi.RSAKeyPair.create(..) all is cool)
>
> Any ideas?
>
> Sean
>
> --
> Dr. Sean Radford, MBBS, MSc
> sra...@ae...
> http://www.aegeus-technology.com
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux Tutorials
> Free Linux tutorial presented by Daniel Robbins, President and CEO of
> GenToo technologies. Learn everything from fundamentals to system
> administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> _______________________________________________
> Jsdsi-users mailing list
> Jsd...@li...
> https://lists.sourceforge.net/lists/listinfo/jsdsi-users
http://ajmani.net
|