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

Leave a Reply

Your email address will not be published.