[fedora-java] Replacement for JCEECDHKeyAgreement

David Walluck david at zarb.org
Thu Feb 27 20:51:13 UTC 2014


On 02/27/2014 03:13 PM, David Juran wrote:
> On ons, 2014-02-26 at 07:02 +0100, Michal Srb wrote:
>> On 02/25/2014 05:15 PM, David Juran wrote:
>> > Hello
>> >
>> > On mån, 2014-02-24 at 09:17 +0100, Michal Srb wrote:
>> >> On 02/24/2014 07:46 AM, David Juran wrote:
>> >>> I would need help with some pointers for how to find a replacement for
>> >>> (the ancient?) org.bouncycastle.jce.provider.JCEECDHKeyAgreement.
>> >> The replacement you are looking for is probably
>> >> "org.bouncycastle.jcajce.provider.asymmetric.ec.KeyAgreementSpi".
>> > Is this class provided in fedora? I can see it in the bouncycastle
>> > sources but not in bcprov.jar. Am I missing something obvious?
>> >
>> 
>> It is, but only in Rawhide. I updated bouncycastle package(s) yesterday.
>> 
>> http://koji.fedoraproject.org/koji/buildinfo?buildID=500443
> 
> Thanks!
> 
> The javadoc sub-package seem a bit... Lacking. It has some examples, but
> the typical API documentation is missing. 
> 
> Also, I don't want to be ungreatful, but any clues what happened to
> org.bouncycastle.jce.provider.JCEIESCipher which used to be in
> bouncycastle-1.46? Any hints of what to use instead?
> 

You can generally ask the JDK for a particular algorithm:

javax.crypto.KeyAgreement ecDH =
javax.crypto.KeyAgreement.getInstance("ECDH");

in a provider-agnostic way so that it should not really be necessary to
get into the BC code.

In fact, I just looked at Azureus and they seem to have commented that
out. Perhaps bouncycastle did not support ECDH at that time?

You can try to delete the InternalDH class and any reference to
bouncycastle and try using the above line instead.



More information about the java-devel mailing list