https://github.com/tomcz/pemtojks
Kotlin command line application to add PEM encoded keys and certificates to Java KeyStores.
https://github.com/tomcz/pemtojks
certificate java-keystore jks kotlin pem
Last synced: 28 days ago
JSON representation
Kotlin command line application to add PEM encoded keys and certificates to Java KeyStores.
- Host: GitHub
- URL: https://github.com/tomcz/pemtojks
- Owner: tomcz
- License: mit
- Created: 2017-11-12T21:45:34.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-12-12T22:03:48.000Z (about 2 years ago)
- Last Synced: 2024-01-29T23:28:03.773Z (about 2 years ago)
- Topics: certificate, java-keystore, jks, kotlin, pem
- Language: Kotlin
- Size: 167 KB
- Stars: 6
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# PEM to JKS
This is a Kotlin command line application that adds PEM-encoded certificates (in X.509 format)
and RSA private keys (in PKCS #8 format) to a Java KeyStore, so that they can be used for
SSL/TLS in Java applications.
## Run the application
To obtain the application bundle you can either build the application using the steps below or download the [latest release](https://github.com/tomcz/pemToJks/releases).
The following example commands are run from the root of the unzipped application bundle.
View help text:
```
$> ./bin/pemToJks -h
usage: pemToJks
-alias Java keystore alias for certificate/key
-aliaspw Java keystore key alias password
-cert Path to PEM certificate file
-h,--help Print this message and exit
-key Path to PEM key file
-store Path to java keystore file
-storepw Java keystore password
```
Add a trusted certificate to a keystore:
NOTE: If the keystore does not exist, it will be created.
```
$> ./bin/pemToJks -cert cert.pem -alias trustme -store test.jks
Reading certificate file
Loading keystore
Adding certificate entry to keystore
Saving keystore
Done
```
Add a certificate chain and private key to a keystore:
NOTE: If the keystore does not exist, it will be created.
```
$> ./bin/pemToJks -cert cert.pem -key key.pem -alias useme -store test.jks
Reading certificate file
Reading key file
Verifying certificate against key
Loading keystore
Adding key & cert chain entry to keystore
Saving keystore
Done
```
## Development
### Requirements
1. Java 11
2. Clone this project
### Build the application
Run the following from the root of the project:
```
make all
```
This creates a `build/distributions/pemToJks.zip` application bundle.