How to create ECDSA keys for authentication?

I am trying to configure a DTLS server on Android based on java example files from Californium.Scandium . I initially ran into problems because the keystore and trust store were in jks format and I did not have key passwords. Therefore, I created my own keystore and PKCS12 store using Portecle.

KeyStore keyStore = KeyStore.getInstance("PKCS12");
in = getResources().openRawResource(R.raw.keystore);
keyStore.load(in, KEY_STORE_PASSWORD.toCharArray());

KeyStore trustStore = KeyStore.getInstance("PKCS12");
inTrust = getResources().openRawResource(R.raw.truststore);
trustStore.load(inTrust, TRUST_STORE_PASSWORD.toCharArray());

After that, the code did not produce any errors while loading the repository, but when I start the application, I get the following:

FATAL EXCEPTION: main
Process: com.example.admin.securesend, PID: 3402
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.example.admin.securesend/com.example.admin.securesend.DTLSServer}: java.lang.IllegalStateException: Keys must be ECDSA capable when support for an ECDHE_ECDSA based cipher suite is configured

: , SHA ECDSA. , , , . ECDSA ?

+4
1

, :

  • RSA. , portecle.
  • DSA: , . .
  • EC: - , .
  • ECDSA: EC.
  • SHA: , - , .

EC keytool ( Java 7 ):

keytool -genkeypair -alias ec -keyalg EC -keysize 256 -sigalg SHA256withECDSA  -validity 365 -storetype JKS -keystore ectest.jks -storepass 123456

256- EC SEC (secp256r1) ECDSA SHA256.

GUI, KeyStore Explorer - EC:

EC key generation with KSE

+3

Source: https://habr.com/ru/post/1620274/


All Articles