Skip to content

Instantly share code, notes, and snippets.

@peterhirn
Created August 22, 2020 06:57
Show Gist options
  • Save peterhirn/8a97eecce1ce34c816353de0c586f877 to your computer and use it in GitHub Desktop.
Save peterhirn/8a97eecce1ce34c816353de0c586f877 to your computer and use it in GitHub Desktop.
Create osslsigncode compatible key/certificate from .pfx
openssl pkcs12 -in authenticode.pfx -nocerts -nodes -out key.pem
openssl pkcs12 -in authenticode.pfx -nokeys -nodes -out cert.pem
openssl rsa -in key.pem -outform DER -out authenticode.key
openssl crl2pkcs7 -nocrl -certfile cert.pem -outform DER -out authenticode.spc
# Encode to store in CI environment variables
base64 authenticode.key > authenticode.key.txt
base64 authenticode.spc > authenticode.spc.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment