Use this tool to seperate Private and Public Key from PFX Files
This commit is contained in:
26
Scissors.ps1
Normal file
26
Scissors.ps1
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
#Scissors - Quick and Dirty Script for extracting private key and certificate from an exported PFX.
|
||||||
|
cls
|
||||||
|
|
||||||
|
#Get Cert path
|
||||||
|
$path = Read-Host "Where is the pfx?"
|
||||||
|
$pass = Read-Host "What is the pfx Password?"
|
||||||
|
|
||||||
|
#Create function Open-Explorer to open the location of the cert - Strips cert.pfx from the $path variable leaving you the folder path. - I know there is easier ways to do this but I just want someone to love me.
|
||||||
|
function Open-Explorer {
|
||||||
|
param(
|
||||||
|
[string]$FilePath
|
||||||
|
)
|
||||||
|
|
||||||
|
$Folder = Split-Path $FilePath -Parent
|
||||||
|
explorer.exe $Folder
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#Seperate certs
|
||||||
|
openssl pkcs12 -in $path -nocerts -out private_key.pem -nodes -password pass:$pass
|
||||||
|
openssl pkcs12 -in $path -clcerts -nokeys -out public_cert.pem -password pass:$pass
|
||||||
|
openssl pkcs12 -in $path -cacerts -nokeys -out cert_chain.pem -password pass:$pass
|
||||||
|
|
||||||
|
Write-host "Jobs done"
|
||||||
|
|
||||||
|
Open-Explorer $path
|
||||||
Reference in New Issue
Block a user