Generating SSL Server CSR with Keytool - dogtagpki/pki GitHub Wiki

Generating SSL Server Key

To generate an RSA key:

$ keytool \
    -genkeypair \
    -keystore keystore.p12 \
    -storetype pkcs12 \
    -storepass Secret.123 \
    -alias sslserver \
    -dname "CN=$HOSTNAME" \
    -keyalg RSA \
    -keypass Secret.123

To generate an ECC key:

$ keytool \
    -genkeypair \
    -keystore keystore.p12 \
    -storetype pkcs12 \
    -storepass Secret.123 \
    -alias sslserver \
    -dname "CN=$HOSTNAME" \
    -keyalg EC \
    -keypass Secret.123

Creating SSL Server CSR

$ keytool \
    -certreq \
    -keystore keystore.p12 \
    -storetype pkcs12 \
    -storepass Secret.123 \
    -alias sslserver \
    -file sslserver.csr

See Also

⚠️ **GitHub.com Fallback** ⚠️