Devo creare il keystore e il truststore con i certificati firmati root.
Ho questi file (in questo passaggio sono identici per client e server):
-  client_cert.pem 
-  client_prv_key.pem 
-  root_cert.pem 
-  client_password diciamo 12345 
Creerò il truststore con il certificato client. Ora ho bisogno di creare il keystore. Ho provato questo:
openssl pkcs12 -export -inkey root_cert.pem -in client_cert.pem -out client.p12
 Questo genera un errore: "   unable to load private key   ". 
 Il comando successivo, dopo aver creato il file   .p12    è (quando il comando openssl terminerà correttamente): 
keytool -importkeystore -srckeystore client.p12 -srcstoretype pkcs12 -destkeystore client.jks -deststoretype jks
 Quale dovrebbe essere il comando per creare il keystore con i certificati firmati da root? Come dovrei creare il file   .p12    con il certificato firmato root? 
Inoltre, per l'autenticazione reciproca nel truststore Java è richiesto. Dopo aver provato alcune opzioni, il modo corretto per creare il truststore è: (12345 è client_password che ho usato in tutti i posti in cui è stata richiesta la password)
   keytool -importcert -trustcacerts -keystore client_truststore.jks -storetype jks -storepass 12345 -file root_cert.pem    
Dove 12345 è client_password (che ho usato in tutte le posizioni in cui era richiesta la password)