#!/bin/sh # kali: 2022-08-11 this is a script that we used to convert certificates in an old format (ca. 2019). openssl pkcs12 -in win.pfx -nocerts -nodes -out key.pem && awk 'NR>2' key.pem > key.plain.pem echo "[+] Encrypting key.pem..." openssl rsa -aes256 -in key.plain.pem -out key.pem && shred -u key.plain.pem openssl pkcs12 -in win.pfx -out win.crt -nokeys -clcerts openssl x509 -inform pem -in win.crt -outform der -out win.cer