jdk/test/sun/security/tools/jarsigner/emptymanifest.sh
author ohair
Tue, 25 May 2010 15:58:33 -0700
changeset 5506 202f599c92aa
parent 3047 30e88a671e72
child 6544 ab54bd98662c
permissions -rw-r--r--
6943119: Rebrand source copyright notices Reviewed-by: darcy, weijun
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3047
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
     1
#
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3047
diff changeset
     2
# Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
3047
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
     4
#
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
     7
# published by the Free Software Foundation.
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
     8
#
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
     9
# This code is distributed in the hope that it will be useful, but WITHOUT
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    10
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    11
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    12
# version 2 for more details (a copy is included in the LICENSE file that
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    13
# accompanied this code).
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    14
#
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    15
# You should have received a copy of the GNU General Public License version
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    16
# 2 along with this work; if not, write to the Free Software Foundation,
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    17
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    18
#
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3047
diff changeset
    19
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3047
diff changeset
    20
# or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3047
diff changeset
    21
# questions.
3047
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    22
#
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    23
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    24
# @test
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    25
# @bug 6712755
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    26
# @summary jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    27
#
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    28
# @run shell emptymanifest.sh
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    29
#
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    30
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    31
if [ "${TESTJAVA}" = "" ] ; then
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    32
  JAVAC_CMD=`which javac`
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    33
  TESTJAVA=`dirname $JAVAC_CMD`/..
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    34
fi
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    35
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    36
# set platform-dependent variables
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    37
OS=`uname -s`
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    38
case "$OS" in
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    39
  Windows_* )
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    40
    FS="\\"
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    41
    ;;
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    42
  * )
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    43
    FS="/"
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    44
    ;;
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    45
esac
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    46
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    47
KS=emptymanifest.jks
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    48
JFILE=em.jar
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    49
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    50
KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore $KS"
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    51
JAR=$TESTJAVA${FS}bin${FS}jar
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    52
JARSIGNER=$TESTJAVA${FS}bin${FS}jarsigner
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    53
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    54
rm $KS $JFILE
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    55
echo A > A
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    56
echo B > B
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    57
mkdir META-INF
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    58
printf "\r\n" > META-INF${FS}MANIFEST.MF
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    59
zip $JFILE META-INF${FS}MANIFEST.MF A B
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    60
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    61
$KT -alias a -dname CN=a -keyalg rsa -genkey -validity 300
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    62
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    63
$JARSIGNER -keystore $KS -storepass changeit $JFILE a || exit 1
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    64
$JARSIGNER -keystore $KS -verify -debug -strict $JFILE || exit 2
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    65
30e88a671e72 6712755: jarsigner fails to sign itextasian.jar since 1.5.0_b14, it works with 1.5.0_13
weijun
parents:
diff changeset
    66
exit 0