Compare commits

..

2 Commits

Author SHA1 Message Date
Zak Bearman
f3c948a173 Merge branch 'main' of https://git.amslabs.net/Rephl3x/Work-Tools 2025-10-01 12:24:12 +13:00
Zak Bearman
33bfea1716 Use this tool to seperate Private and Public Key from PFX Files 2025-10-01 12:21:02 +13:00

26
Scissors.ps1 Normal file
View 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