jdk/test/sun/security/tools/jarsigner/TimestampCheck.java
changeset 45287 e0bb5f83e17a
parent 44046 762e807bfac1
child 45467 99c87a16a8e4
equal deleted inserted replaced
45286:cd809e28c082 45287:e0bb5f83e17a
     1 /*
     1 /*
     2  * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2003, 2017, 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.
    43 import java.util.jar.JarEntry;
    43 import java.util.jar.JarEntry;
    44 import java.util.jar.JarFile;
    44 import java.util.jar.JarFile;
    45 
    45 
    46 import jdk.test.lib.SecurityTools;
    46 import jdk.test.lib.SecurityTools;
    47 import jdk.testlibrary.*;
    47 import jdk.testlibrary.*;
    48 import jdk.testlibrary.JarUtils;
    48 import jdk.test.lib.util.JarUtils;
    49 import sun.security.pkcs.ContentInfo;
    49 import sun.security.pkcs.ContentInfo;
    50 import sun.security.pkcs.PKCS7;
    50 import sun.security.pkcs.PKCS7;
    51 import sun.security.pkcs.PKCS9Attribute;
    51 import sun.security.pkcs.PKCS9Attribute;
    52 import sun.security.pkcs.SignerInfo;
    52 import sun.security.pkcs.SignerInfo;
    53 import sun.security.timestamp.TimestampToken;
    53 import sun.security.timestamp.TimestampToken;
   555         args.addAll(Arrays.asList(extra));
   555         args.addAll(Arrays.asList(extra));
   556         return jarsigner(args);
   556         return jarsigner(args);
   557     }
   557     }
   558 
   558 
   559     static void prepare() throws Exception {
   559     static void prepare() throws Exception {
   560         jdk.testlibrary.JarUtils.createJar("old.jar", "A");
   560         JarUtils.createJar("old.jar", "A");
   561         Files.deleteIfExists(Paths.get("tsks"));
   561         Files.deleteIfExists(Paths.get("tsks"));
   562         keytool("-alias ca -genkeypair -ext bc -dname CN=CA");
   562         keytool("-alias ca -genkeypair -ext bc -dname CN=CA");
   563         keytool("-alias old -genkeypair -dname CN=old");
   563         keytool("-alias old -genkeypair -dname CN=old");
   564         keytool("-alias dsakey -genkeypair -keyalg DSA -dname CN=dsakey");
   564         keytool("-alias dsakey -genkeypair -keyalg DSA -dname CN=dsakey");
   565         keytool("-alias weakkeysize -genkeypair -keysize 512 -dname CN=weakkeysize");
   565         keytool("-alias weakkeysize -genkeypair -keysize 512 -dname CN=weakkeysize");