Issue personal certificate with keytool

產生名為test_keystore,10年有效期限的keystore:

@echo off
set KEYTOOL=C:\Program Files\Java\jdk1.8.0_91\bin\keytool.exe
set KEYSTORE=C:\Program Files\Java\jdk1.8.0_91\bin\test_keystore
set ALIAS=test_keystore
 
"%KEYTOOL%" -keystore "%KEYSTORE%" -alias %ALIAS% -genkey -keyalg RSA -validity 3650

執行畫面如下:

用來確認keystore的內容,我主要確認演算法與有效期間:

@echo off
 
set KEYTOOL=C:\Program Files\Java\jdk1.8.0_91\bin\keytool.exe
set KEYSTORE=C:\Program Files\Java\jdk1.8.0_91\bin\test_keystore
 
"%KEYTOOL%" -list -v -keystore "%KEYSTORE%"
 
pause

執行結果如下: