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