Skip to content

Instantly share code, notes, and snippets.

@kedwards
Last active October 17, 2023 13:10
Show Gist options
  • Save kedwards/d452c1d2209b6073d3a57f30df1f8597 to your computer and use it in GitHub Desktop.
Save kedwards/d452c1d2209b6073d3a57f30df1f8597 to your computer and use it in GitHub Desktop.

Revisions

  1. kedwards renamed this gist Oct 17, 2023. 1 changed file with 7 additions and 3 deletions.
    10 changes: 7 additions & 3 deletions pem2pkcs12 → pem2pkcs12.md
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,15 @@
    # Convert cert.pem and private key key.pem into a single cert.p12 file, key in the key-store-password manually for the .p12 file.
    # PEM to PKCS12

    **SSL – Convert PEM and private key to PKCS#12**

    Convert cert.pem and private key key.pem into a single cert.p12 file, key in the key-store-password manually for the .p12 file.

    ``` openssl pkcs12 -export -out cert.p12 -in cert.pem -inkey key.pem ```

    # No password for cert.p12
    No password

    ``` openssl pkcs12 -export -out cert.p12 -in cert.pem -inkey key.pem -passout pass: -nokeys ```

    # Password 123 for cert.p12
    Password is 123

    ``` openssl pkcs12 -export -out cert.p12 -in cert.pem -inkey key.pem -passout pass: 123 ```
  2. kedwards created this gist Oct 17, 2023.
    11 changes: 11 additions & 0 deletions pem2pkcs12
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    # Convert cert.pem and private key key.pem into a single cert.p12 file, key in the key-store-password manually for the .p12 file.

    ``` openssl pkcs12 -export -out cert.p12 -in cert.pem -inkey key.pem ```

    # No password for cert.p12

    ``` openssl pkcs12 -export -out cert.p12 -in cert.pem -inkey key.pem -passout pass: -nokeys ```

    # Password 123 for cert.p12

    ``` openssl pkcs12 -export -out cert.p12 -in cert.pem -inkey key.pem -passout pass: 123 ```