1# 2# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. 3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4# 5# This code is free software; you can redistribute it and/or modify it 6# under the terms of the GNU General Public License version 2 only, as 7# published by the Free Software Foundation. 8# 9# This code is distributed in the hope that it will be useful, but WITHOUT 10# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12# version 2 for more details (a copy is included in the LICENSE file that 13# accompanied this code). 14# 15# You should have received a copy of the GNU General Public License version 16# 2 along with this work; if not, write to the Free Software Foundation, 17# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18# 19# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20# or visit www.oracle.com if you need additional information or have any 21# questions. 22# 23 24# @test 25# @bug 6561126 26# @summary keytool should use larger default keysize for keypairs 27# 28# @run shell newsize7.sh 29 30# set a few environment variables so that the shell-script can run stand-alone 31# in the source directory 32if [ "${TESTSRC}" = "" ] ; then 33 TESTSRC="." 34fi 35 36if [ "${TESTJAVA}" = "" ] ; then 37 JAVA_CMD=`which java` 38 TESTJAVA=`dirname $JAVA_CMD`/.. 39fi 40 41# set platform-dependent variables 42OS=`uname -s` 43case "$OS" in 44 Windows_* ) 45 FS="\\" 46 ;; 47 * ) 48 FS="/" 49 ;; 50esac 51 52KSFILE=ns7.jks 53 54KT="${TESTJAVA}${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -keystore ns7.jks -storepass changeit -keypass changeit -keyalg rsa" 55JAR="${TESTJAVA}${FS}bin${FS}jar ${TESTTOOLVMOPTS}" 56JS="${TESTJAVA}${FS}bin${FS}jarsigner ${TESTTOOLVMOPTS} -keystore ns7.jks -storepass changeit" 57 58rm ns7.* 59 60$KT -genkeypair -alias me -dname CN=Me 61 62touch ns7.txt 63$JAR cvf ns7.jar ns7.txt 64 65$JS ns7.jar me 66$JAR xvf ns7.jar 67 68grep SHA-256 META-INF/MANIFEST.MF || exit 1 69grep SHA-256 META-INF/ME.SF || exit 2 70 71#rm -rf META-INF 72 73exit 0 74