@ECHO OFF
TITLE WinXP-IE - Certificate Creator
PushD "%~dp0"

ECHO                                      \\!//
ECHO                                      (o o)
ECHO ---------------------------------oOOo-(_)-oOOo---------------------------------
ECHO               Windows XP - Integral Edition - Certificate Creator
ECHO INFO: You need to place the "Root Certificate Authority" registry entry into
ECHO the file ".\I386\WXPIERO.inf" to automatically install the new Certificate.
ECHO ===============================================================================
PAUSE

ECHO.
ECHO Deleting Old Certificates . . .
ping -n 3 localhost 1>NUL
DEL /f /q ".\Certificates\*" 2>NUL

ECHO.
ECHO Set the password for the "Root Certificate Authority" . . .
ping -n 3 localhost 1>NUL
".\makecert.exe" -r -pe -n "CN=Zone 54 Root Certificate Authority,O=Umbrella Corporation,OU=IT Department" -cy authority -sky signature -a sha1 -len 2048 -e 12/31/9999 -sv ".\Certificates\Self-signed Certificate Authority.pvk" ".\Certificates\Self-signed Certificate Authority.cer" 1>NUL

ECHO.
ECHO Set the password for the "Code-signing Certificate" and then confirm the
ECHO "Code-signing Certificate" and the "Root Certificate Authority" password . . .
ping -n 3 localhost 1>NUL
".\makecert.exe" -pe -n "CN=Windows XP Integral Edition,O=Umbrella Corporation,OU=IT Department" -cy end -sky signature -eku 1.3.6.1.5.5.7.3.3,1.3.6.1.4.1.311.10.3.6 -a sha1 -len 2048 -e 12/31/9999 -iv ".\Certificates\Self-signed Certificate Authority.pvk" -ic ".\Certificates\Self-signed Certificate Authority.cer" -sv ".\Certificates\Code-signing Certificate.pvk" ".\Certificates\Code-signing Certificate.cer" 1>NUL

ECHO.
ECHO Enter the "Code-signing Certificate" password . . .
ping -n 3 localhost 1>NUL
".\pvk2pfx.exe" -pvk ".\Certificates\Code-signing Certificate.pvk" -spc ".\Certificates\Code-signing Certificate.cer" -po "zone54.com" -pfx ".\Certificates\Code-signing Certificate.pfx" -f

::"signtool.exe" sign /f ".\Certificates\Code-signing Certificate.pfx" /p "zone54.com" /d "All modified files are signed by this catalog file." /du "http://zone54.com" /t "http://timestamp.digicert.com" /v "9-WXPIE.cat"

ECHO.
ECHO ----------------------------------[Finished]-----------------------------------
ping -n 5 localhost 1>NUL
EXIT
