java:keytool:list-certificates-from-jks
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
java:keytool:list-certificates-from-jks [2020/08/08 19:37] – odefta | java:keytool:list-certificates-from-jks [2020/08/08 19:58] – odefta | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Create keystore jks file ====== | ====== Create keystore jks file ====== | ||
- | In keystore we want to import the certificate chain and the private key. | + | In keystore we want to import: |
+ | * **the certificate chain** | ||
+ | * **the private key** | ||
We can't do this directly in keytool. \\ | We can't do this directly in keytool. \\ | ||
A PKCS12 file should be created which then will be imported in keystore. | A PKCS12 file should be created which then will be imported in keystore. | ||
Line 15: | Line 17: | ||
</ | </ | ||
+ | ===== Import the p12 file into a jks file ===== | ||
+ | Replace the password123 with the private key password supplied when it was created. | ||
+ | < | ||
+ | keytool -importkeystore -deststorepass password123 -destkeystore keystore_custom.jks -srckeystore snt.p12 -srcstoretype PKCS12 | ||
+ | </ | ||
+ | |||
+ | Output: | ||
+ | < | ||
+ | Importing keystore snt.p12 to keystore_custom.jks... | ||
+ | Enter source keystore password: | ||
+ | Entry for alias sentinel successfully imported. | ||
+ | Import command completed: | ||
+ | |||
+ | Warning: | ||
+ | The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format using " | ||
+ | </ | ||
====== List JKS entries (certificates) ====== | ====== List JKS entries (certificates) ====== |
java/keytool/list-certificates-from-jks.txt · Last modified: 2023/07/04 19:36 by 127.0.0.1