Files
powershell/conv-Pfx-to-pem.ps1
2023-03-09 09:06:25 +01:00

21 lines
864 B
PowerShell

#Konverter pfx-fil til PEM-fil
#Konvertering til en kombineret PEM-fil
#For at konvertere en PFX-fil til en PEM-fil, der indeholder både certifikatet og den private nøgle, skal følgende kommando bruges:
mkdir c:\certconv
Copy-Item -Recurse -Force "C:\Users\$env:username\Downloads\star.east-west.dk-2024-02-05" -Destination c:\certconv
cd C:\Users\$env:username\Downloads\star.east-west.dk-2024-02-05\
#run "" in cmd (with openssl installed on pc)
powershell -command "openssl pkcs12 -in .\star.east-west.dk-2024-02-05.pfx -out ewdk.key"
powershell -command "openssl rsa -in .\star.east-west.dk.key -out ewdkdecrypt.key"
remove-item .\ewdk.key
powershell -command "openssl pkcs12 -in .\star.east-west.dk-2024-02-05.pfx -clcerts -nokeys -out ewdkcert.crt"
powershell -command "pkcs12 -in star.east-west.dk-2024-02-05.pfx -cacerts -out ewdkbundle.crt"