< prev index next >

test/sun/security/tools/keytool/ReadJar.java

Print this page
rev 17325 : 8181761: add explicit @build actions for jdk.test.lib classes in all :tier2 tests
Reviewed-by: duke


   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 /**
  25  * @test
  26  * @bug 6890872 8168882
  27  * @summary keytool -printcert to recognize signed jar files
  28  * @library /test/lib









  29  */
  30 
  31 import java.nio.file.Files;
  32 import java.nio.file.Paths;
  33 import jdk.test.lib.SecurityTools;
  34 import jdk.test.lib.process.OutputAnalyzer;
  35 import jdk.test.lib.util.JarUtils;
  36 
  37 public class ReadJar {
  38 
  39     public static void main(String[] args) throws Throwable {
  40         testWithMD5();
  41     }
  42 
  43     // make sure that -printcert option works
  44     // if a weak algorithm was used for signing a jar
  45     private static void testWithMD5() throws Throwable {
  46         // create jar files
  47         JarUtils.createJar("test_md5.jar", "test");
  48         JarUtils.createJar("test_rsa.jar", "test");




   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 /**
  25  * @test
  26  * @bug 6890872 8168882
  27  * @summary keytool -printcert to recognize signed jar files
  28  * @library /test/lib
  29  * @build jdk.test.lib.SecurityTools
  30  *        jdk.test.lib.util.JarUtils
  31  *        jdk.test.lib.Utils
  32  *        jdk.test.lib.Asserts
  33  *        jdk.test.lib.JDKToolFinder
  34  *        jdk.test.lib.JDKToolLauncher
  35  *        jdk.test.lib.Platform
  36  *        jdk.test.lib.process.*
  37  * @run main ReadJar
  38  */
  39 
  40 import java.nio.file.Files;
  41 import java.nio.file.Paths;
  42 import jdk.test.lib.SecurityTools;
  43 import jdk.test.lib.process.OutputAnalyzer;
  44 import jdk.test.lib.util.JarUtils;
  45 
  46 public class ReadJar {
  47 
  48     public static void main(String[] args) throws Throwable {
  49         testWithMD5();
  50     }
  51 
  52     // make sure that -printcert option works
  53     // if a weak algorithm was used for signing a jar
  54     private static void testWithMD5() throws Throwable {
  55         // create jar files
  56         JarUtils.createJar("test_md5.jar", "test");
  57         JarUtils.createJar("test_rsa.jar", "test");


< prev index next >