...
Convert a JKS (.jks) keystore to a PKCS12 (.pfx) keystore by running the following command:
Code Block language none keytool -importkeystore -srckeystore [MY_KEYSTORE.jks] -destkeystore [MY_FILE.pfx] -srcstoretype JKS -deststoretype PKCS12
The PKCS12 file format, also commonly known as PFX, is used to combine one or more digital certificates and a private key into a single file.
Run the following command to create a file containing only the certificates using the .p12 file.
Code Block openssl pkcs12 -in [MY_FILE.pfx] -nokeys -out [MY_File.crt]
Run the following command to generate private key using the .p12 file.
Code Block openssl pkcs12 -in [MY_FILE.pfx] -nocerts -nodes -out [MY_Private.key]
...
Run the following commands to convert the certificate and the private key to Base64 encoding respectively:
Code Block |
---|
cat [MY_File.crt] | base64 -w0 |
Code Block |
---|
cat [MY_Private.key] | base64 -w0 |