Skip to content

Instantly share code, notes, and snippets.

@gorlok
Last active July 3, 2024 23:13
Show Gist options
  • Save gorlok/51731eaaddbef0fdf0d888438856ea22 to your computer and use it in GitHub Desktop.
Save gorlok/51731eaaddbef0fdf0d888438856ea22 to your computer and use it in GitHub Desktop.
OpenSSL to create PFX file

source: https://github.com/Azure/azure-xplat-cli/wiki/Getting-Self-Signed-SSL-Certificates-(.pem-and-.pfx)

  • Generating a private key:
openssl genrsa 2048 > private.pem
  • Generating the self signed certificate:
openssl req -x509 -new -key private.pem -out public.pem
  • If required, creating PFX:
openssl pkcs12 -export -in public.pem -inkey private.pem -out mycert.pfx 
  • Check PFX contents:
 openssl pkcs12 -info -in mycert.pfx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment