< prev index next >

test/sun/security/tools/jarsigner/concise_jarsigner.sh

Print this page
rev 16540 : 8171319: keytool should print out warnings when reading or generating cert/cert req using weak algorithms


 218 # if cert is imported, -certchain won't work because this certificate entry is not trusted
 219 $KT -importcert -file certchain -alias altchain -noprompt
 220 $JARSIGNER -strict -keystore $KS -storepass changeit -certchain certchain a.jar altchain
 221 [ $? = 4 ] || exit $LINENO
 222 
 223 $JARSIGNER -verify a.jar
 224 [ $? = 0 ] || exit $LINENO
 225 
 226 # ==========================================================
 227 # 8172529
 228 # ==========================================================
 229 
 230 $KT -genkeypair -alias ee -dname CN=ee
 231 $KT -genkeypair -alias caone -dname CN=caone
 232 $KT -genkeypair -alias catwo -dname CN=catwo
 233 
 234 $KT -certreq -alias ee | $KT -gencert -alias catwo -rfc > ee.cert
 235 $KT -certreq -alias catwo | $KT -gencert -alias caone -sigalg MD5withRSA -rfc > catwo.cert
 236 
 237 # This certchain contains a cross-signed weak catwo.cert
 238 cat ee.cert catwo.cert | $KT -importcert -alias ee
 239 
 240 $JAR cvf a.jar A1.class
 241 $JARSIGNER -strict -keystore $KS -storepass changeit a.jar ee
 242 [ $? = 0 ] || exit $LINENO
 243 $JARSIGNER -strict -keystore $KS -storepass changeit -verify a.jar
 244 [ $? = 0 ] || exit $LINENO
 245 
 246 echo OK
 247 exit 0


 218 # if cert is imported, -certchain won't work because this certificate entry is not trusted
 219 $KT -importcert -file certchain -alias altchain -noprompt
 220 $JARSIGNER -strict -keystore $KS -storepass changeit -certchain certchain a.jar altchain
 221 [ $? = 4 ] || exit $LINENO
 222 
 223 $JARSIGNER -verify a.jar
 224 [ $? = 0 ] || exit $LINENO
 225 
 226 # ==========================================================
 227 # 8172529
 228 # ==========================================================
 229 
 230 $KT -genkeypair -alias ee -dname CN=ee
 231 $KT -genkeypair -alias caone -dname CN=caone
 232 $KT -genkeypair -alias catwo -dname CN=catwo
 233 
 234 $KT -certreq -alias ee | $KT -gencert -alias catwo -rfc > ee.cert
 235 $KT -certreq -alias catwo | $KT -gencert -alias caone -sigalg MD5withRSA -rfc > catwo.cert
 236 
 237 # This certchain contains a cross-signed weak catwo.cert
 238 cat ee.cert catwo.cert | $KT -importcert -alias ee -noprompt
 239 
 240 $JAR cvf a.jar A1.class
 241 $JARSIGNER -strict -keystore $KS -storepass changeit a.jar ee
 242 [ $? = 0 ] || exit $LINENO
 243 $JARSIGNER -strict -keystore $KS -storepass changeit -verify a.jar
 244 [ $? = 0 ] || exit $LINENO
 245 
 246 echo OK
 247 exit 0
< prev index next >