Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create certificate keystore file AES 128

I'm trying to create certificate key-store file with command line but it gives me an exception:

c:\Program Files\Java\jre7\bin>keytool.exe -genkey -alias srccodes -keyalg AES -
keystore C:\srccodes.jks -keysize 128
Enter keystore password:
Re-enter new password:
keytool error: java.lang.Exception: Cannot derive signature algorithm
like image 435
Lê Đức Nguyên Avatar asked Oct 15 '25 19:10

Lê Đức Nguyên


1 Answers

-genkey option is for generating a public key and associated private key, so it only works with asymmetric algorithm (AES is symmetric so you can't use -genkey with it).

Use -genseckey instead. Note also that JKS can not store non public-key pairs, so you must use JCEKS format, to specify this add -storeType JCEKS, finally your command must be:

keytool.exe -genseckey-alias srccodes -keyalg AES -keystore C:\srccodes.jceks -keysize 128 -storeType JCEKS

For more info take a look at: Keytool documentation

Hope this helps,

like image 75
albciff Avatar answered Oct 19 '25 09:10

albciff