Re: Replacement for JCEECDHKeyAgreement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/03/2014 03:39 AM, David Juran wrote:
> Is there any way of knowing which crypto:s are supported by a specific
> bouncycastle installation? I.e. will this work with bouncycastle-1.46 on
> F20 or will it require rawhide with bouncycastle-1.50?

The easiest way to check is to make a test class and to put the call
from the last email inside a try..catch block as it will throw a
NoSuchAlgorithmException if it's not supported in that version.

To look for the supported algorithms more specifically, it is a bit
complicated since DH is actually an alias. I don't currenly have EC on
my system, but it will look something like:
Alg.Alias.KeyAgreement.DH:DiffieHellman (but the EC variant).

You could start with something like: java.security.Provider p =
java.security.Security.getProviders(). Here p.getName() will return
something like "BC" for bouncycastle. Then, you could iterate over
java.security.Provider.stringPropertyNames(). At least if you use this
code you can verify that the BC provider is loaded and all of the
algorithms that it supports.

NB: In the code I gave in the last email, the addition of the second
argument "BC" will force the BC provider to be used, otherwise it will
check all available providers. I think you should actually prefer to
check them all, although it does not look like the SunEC Provider is
available in OpenJDK which will make having BC loaded a requirement.

--
java-devel mailing list
java-devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/java-devel





[Index of Archives]     [Red Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux