jdk/test/sun/security/tools/jarsigner/passtype.sh
changeset 28243 47080f9ae750
parent 24116 9f9b4ba34aad
equal deleted inserted replaced
28242:0cbef7c46996 28243:47080f9ae750
     1 #
     1 #
     2 # Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
     2 # Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
     3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4 #
     4 #
     5 # This code is free software; you can redistribute it and/or modify it
     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
     6 # under the terms of the GNU General Public License version 2 only, as
     7 # published by the Free Software Foundation.
     7 # published by the Free Software Foundation.
    40   * )
    40   * )
    41     FS="/"
    41     FS="/"
    42     ;;
    42     ;;
    43 esac
    43 esac
    44 
    44 
    45 KS=pt.jks
    45 KS=pt.ks
    46 JFILE=pt.jar
    46 JFILE=pt.jar
    47 
    47 
    48 KT="$TESTJAVA${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -keystore $KS -validity 300 -keyalg rsa"
    48 KT="$TESTJAVA${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -keystore $KS -validity 300 -keyalg rsa"
    49 JAR="$TESTJAVA${FS}bin${FS}jar ${TESTTOOLVMOPTS}"
    49 JAR="$TESTJAVA${FS}bin${FS}jar ${TESTTOOLVMOPTS}"
    50 JARSIGNER="$TESTJAVA${FS}bin${FS}jarsigner ${TESTTOOLVMOPTS}"
    50 JARSIGNER="$TESTJAVA${FS}bin${FS}jarsigner ${TESTTOOLVMOPTS}"
    60         -storepass:file passfile -keypass:file passfile || exit 3
    60         -storepass:file passfile -keypass:file passfile || exit 3
    61 
    61 
    62 echo A > A
    62 echo A > A
    63 $JAR cvf $JFILE A
    63 $JAR cvf $JFILE A
    64 
    64 
       
    65 # Sign
    65 $JARSIGNER -keystore $KS -storepass test12 $JFILE a || exit 4
    66 $JARSIGNER -keystore $KS -storepass test12 $JFILE a || exit 4
    66 PASSENV=test12 $JARSIGNER -keystore $KS -storepass:env PASSENV $JFILE b || exit 5
    67 PASSENV=test12 $JARSIGNER -keystore $KS -storepass:env PASSENV $JFILE b || exit 5
    67 $JARSIGNER -keystore $KS -storepass:file passfile $JFILE b || exit 6
    68 $JARSIGNER -keystore $KS -storepass:file passfile $JFILE b || exit 6
    68 
    69 
    69 $JARSIGNER -keystore $KS -verify -debug -strict $JFILE || exit 7
    70 # Verify
       
    71 $JARSIGNER -keystore $KS -storepass test12 -verify -debug -strict $JFILE || exit 7
       
    72 PASSENV=test12 $JARSIGNER -keystore $KS -storepass:env PASSENV -verify -debug -strict $JFILE || exit 8
       
    73 $JARSIGNER -keystore $KS -storepass:file passfile -verify -debug -strict $JFILE || exit 9
    70 
    74 
    71 exit 0
    75 exit 0
    72 
    76