1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
| signer.properties file
#Properties file for signer.bat & makecert.bat
#Defines the overall settings for Signing PJC jars
#Lines prefixed with # are ignored
#Directory Settings - ** change these to suit your system **
#do not include trailing "\"
JDK_HOME=c:\DevSuiteHome\jdk
JINIT_HOME=C:\Program Files\Java\jre1.6.0_03
#Certificate settings:
# These are used to generate the initial signing certificate
# Change them to suite your organisation
DN_CN=my_name
DN_OU=DevTeam
DN_O=Znort
DN_C=fr
JAR_KEY=my_key
JAR_KEY_PASSWORD=my_password
makecert.bat file
@echo off
REM ******************************************************************
REM * This script generates a Self Signing certificate for
REM * JAR files using the parameters defined in the signer.properties
REM * file
REM * This script only needs to be run once to create the certificate
REM * The certificate will be valid for 360 days
REM ******************************************************************
REM * 18-JUN-2003 DRMILLS - Creation
REM ******************************************************************
for /F "eol=# tokens=1,2* delims==" %%i in (signer.properties) do set %%i=%%j
"c:\DevSuiteHome_1\jdk\bin\keytool" -genkey -dname "cn=my_name, ou=DevTeam, o=Znort, c=fr" -alias my_key -keypass my_password -keystore "C:\Program Files\Java\jre1.6.0_03\lib\security\keystore" -storepass jinitiator -validity 999
@echo Certificate created...
sign.bat file
cls
@echo off
REM ******************************************************************
REM * This script signs a jar file using the certificate
REM * defined in the signer.properties file
REM *
REM * This script can be run as often as is required on any jar
REM * A backup copy of the jar file is created
REM ******************************************************************
REM * 18-JUN-2003 DRMILLS - Creation
REM *******************************
for /F "eol=# tokens=1,2* delims==" %%i in (signer.properties) do set %%i=%%j
copy /Y %1 %1.unsigned
@echo on
"c:\DevSuiteHome_1\jdk\bin\jarsigner" -keystore "C:\Program Files\Java\jre1.6.0_03\lib\security\keystore" -storepass jinitiator -keypass my_password %1 my_key
@echo Signing complete... |