Skip to content

Instantly share code, notes, and snippets.

@QuiltMeow
Last active February 3, 2024 12:13
Show Gist options
  • Save QuiltMeow/a4d9acc77e683decb281299e9cba4e70 to your computer and use it in GitHub Desktop.
Save QuiltMeow/a4d9acc77e683decb281299e9cba4e70 to your computer and use it in GitHub Desktop.
PFX To CRT And KEY
@echo off
set OPEN_SSL="C:\Program Files\OpenSSL-Win64\bin\openssl.exe"
set /P FILE=Input PFX Key File Name :
rem Extract Encrypt Private Key
%OPEN_SSL% pkcs12 -in %FILE% -nocerts -out encrypt.key
rem Extract Public Key
%OPEN_SSL% pkcs12 -in %FILE% -clcerts -nokeys -out certificate.crt
rem Extract Decrypt Private Key
%OPEN_SSL% rsa -in encrypt.key -out private.key
del encrypt.key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment