Search code examples
javakeytool

Keytool EC KeyPairGenerator not available


When I use keytool to generate a key with ECC, I get this error:

Error keytool: java.security.NoSuchAlgorithmException: EC KeyPairGenerator not available

Then syntax used to generate a key is:

keytool -genkey -alias testing -keyalg EC -keysize 256 -keystore try.jks -dname "CN=localhost,OU=dep,O=lks,L=ny,ST=ny,C=USA"

I have this Java version:

openjdk version "1.8.0_60"
OpenJDK Runtime Environment (build 1.8.0_60-b16)                            
OpenJDK 64-Bit Server VM (build 25.60-b16, mixed mode)

Solution

  • I solved the problem by reading the following article (linked by the user @QuakeCore). If someone has the same issue, he/she can solve by following my steps:

    1. Download Java Oracle (tar.gz);
    2. Copy the file jdk1.8.0_*/jre/lib/amd64/libsunec.so from extracted folder to /usr/lib/jvm/java-1.8.0-openjdk.x86_64/jre/lib/amd64/libsunec.so;
    3. Use the syntax written in my original question to generate the key.