Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a certificate into a PKCS12 keystore with keytool?

Tags:

I wanted to create a certificate into a PKCS12 keystore format with keytool program.

The keystore has extension .pfx.

How do I achieve this?

like image 930
David García González Avatar asked Jan 17 '13 08:01

David García González


People also ask

What is pkcs12 keystore?

The PKCS#12 (Personal Information Exchange Syntax Standard) specifies a portable format for storage and/or transport of a user's private keys, certificates, miscellaneous secrets, and other items. The IBMJSSE2 provider uses the Java™ 2 KeyStore API that supplies a complete implementation of the PKCS12 java. security.


1 Answers

If the keystore is PKCS12 type (.pfx) you have to specify it with -storetype PKCS12 (line breaks added for readability):

keytool -genkey -alias <desired certificate alias>      -keystore <path to keystore.pfx>     -storetype PKCS12      -keyalg RSA      -storepass <password>      -validity 730      -keysize 2048  
like image 74
David García González Avatar answered Oct 06 '22 17:10

David García González