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 /*
25 * @test
26 * @bug 6468285
27 * @summary keytool ability to backdate self-signed certificates to compensate for clock skew
28 * @compile -XDignore.symbol.file StartDateTest.java
29 * @run main StartDateTest
30 */
31
32 import java.io.File;
33 import java.io.FileInputStream;
34 import java.lang.reflect.Method;
35 import java.security.KeyStore;
36 import java.security.cert.X509Certificate;
37 import java.util.Calendar;
38 import java.util.Date;
39 import java.util.GregorianCalendar;
40
41 public class StartDateTest {
42 public static void main(String[] args) throws Exception {
43
44 // Part 1: Test function
45 Calendar cal = new GregorianCalendar();
46 int year = cal.get(Calendar.YEAR);
47 int month = cal.get(Calendar.MONTH);
|
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 /*
25 * @test
26 * @bug 6468285
27 * @summary keytool ability to backdate self-signed certificates to compensate for clock skew
28 * @modules java.base/sun.security.tools.keytool
29 * @compile -XDignore.symbol.file StartDateTest.java
30 * @run main StartDateTest
31 */
32
33 import java.io.File;
34 import java.io.FileInputStream;
35 import java.lang.reflect.Method;
36 import java.security.KeyStore;
37 import java.security.cert.X509Certificate;
38 import java.util.Calendar;
39 import java.util.Date;
40 import java.util.GregorianCalendar;
41
42 public class StartDateTest {
43 public static void main(String[] args) throws Exception {
44
45 // Part 1: Test function
46 Calendar cal = new GregorianCalendar();
47 int year = cal.get(Calendar.YEAR);
48 int month = cal.get(Calendar.MONTH);
|