Skip to content

Instantly share code, notes, and snippets.

@ripsnortntear
Created March 31, 2025 06:26
Show Gist options
  • Save ripsnortntear/251d57c9a31e550bffb68291d21bc4f9 to your computer and use it in GitHub Desktop.
Save ripsnortntear/251d57c9a31e550bffb68291d21bc4f9 to your computer and use it in GitHub Desktop.
This script converts an SSL certificate and its private key into a PFX file format, specifying output paths and a password for the PFX file.
#!/bin/bash
# Define paths
CERT_PATH="/path/to/cert.pem"
KEY_PATH="/path/to/key.pem"
PFX_PATH="/path/to/output.pfx"
PFX_PASSWORD="your_password" # Set a password for the PFX file
# Create the PFX file
openssl pkcs12 -export -out "$PFX_PATH" -inkey "$KEY_PATH" -in "$CERT_PATH" -passout pass:"$PFX_PASSWORD"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment