emptymanifest.sh revision 2362
787N/A#
1472N/A# Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
787N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
787N/A#
787N/A# This code is free software; you can redistribute it and/or modify it
787N/A# under the terms of the GNU General Public License version 2 only, as
787N/A# published by the Free Software Foundation.
787N/A#
787N/A# This code is distributed in the hope that it will be useful, but WITHOUT
787N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
787N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
787N/A# version 2 for more details (a copy is included in the LICENSE file that
787N/A# accompanied this code).
787N/A#
787N/A# You should have received a copy of the GNU General Public License version
787N/A# 2 along with this work; if not, write to the Free Software Foundation,
787N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
787N/A#
1472N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1472N/A# or visit www.oracle.com if you need additional information or have any
1472N/A# questions.
787N/A#
787N/A
787N/A# @test
787N/A# @bug 6712755
787N/A# @summary jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
787N/A#
787N/A# @run shell emptymanifest.sh
787N/A#
787N/A
787N/Aif [ "${TESTJAVA}" = "" ] ; then
787N/A JAVAC_CMD=`which javac`
787N/A TESTJAVA=`dirname $JAVAC_CMD`/..
787N/Afi
787N/A
787N/A# set platform-dependent variables
787N/AOS=`uname -s`
787N/Acase "$OS" in
787N/A Windows_* )
787N/A FS="\\"
787N/A ;;
787N/A * )
787N/A FS="/"
787N/A ;;
787N/Aesac
787N/A
787N/AKS=emptymanifest.jks
787N/AJFILE=em.jar
787N/A
787N/AKT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore $KS"
787N/AJAR=$TESTJAVA${FS}bin${FS}jar
787N/AJARSIGNER=$TESTJAVA${FS}bin${FS}jarsigner
787N/A
787N/Arm $KS $JFILE
787N/Aecho A > A
787N/Aecho B > B
787N/Amkdir META-INF
787N/Aprintf "\r\n" > META-INF${FS}MANIFEST.MF
787N/Azip $JFILE META-INF${FS}MANIFEST.MF A B
787N/A
787N/A$KT -alias a -dname CN=a -keyalg rsa -genkey -validity 300
787N/A
787N/A$JARSIGNER -keystore $KS -storepass changeit $JFILE a || exit 1
787N/A$JARSIGNER -keystore $KS -verify -debug -strict $JFILE || exit 2
787N/A
exit 0