Skip to content

Instantly share code, notes, and snippets.

@smailliwcs
Created September 22, 2020 15:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smailliwcs/72bc60dd46c8132ecf72bf357e758771 to your computer and use it in GitHub Desktop.
Save smailliwcs/72bc60dd46c8132ecf72bf357e758771 to your computer and use it in GitHub Desktop.
Creating self-signed certificates
@echo off
setlocal
set cn=%~1
if "%cn%" == "" goto :usage
makecert -sv "%cn%.pvk" -n "CN=%cn%" -b 01/01/2000 -e 12/31/2999 -r "%cn%.cer"
pvk2pfx -pvk "%cn%.pvk" -spc "%cn%.cer" -pfx "%cn%.pfx"
goto :eof
:usage
echo Usage: %0 CN
goto :eof
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment