Often you encounter a situation where a BATCH file, much the same as a shell script, will do the job as your installer or configuration tool.
@echo off
cls
echo SSL Certificate Generator
echo.
SET /P MACHINE_NAME=Enter machine name or Q(Quit)
IF %MACHINE_NAME%==q goto end
IF %MACHINE_NAME%==Q goto end
echo Generating certificate for machine %MACHINE_NAME%
keytool -genkey -alias %MACHINE_NAME% -dname "CN=%MACHINE_NAME%, OU=OpenLogbooks, O=OpenLogbooks, L=Lichfield, S=Staffordshire, C=UK" -keyalg RSA -keypass password -storepass password -keystore mykeystore.keystore
keytool -export -alias %MACHINE_NAME% -storepass password -file mykeystore.server.crt -keystore mykeystore.keystore
:end
No comments:
Post a Comment