File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
test/jdk/sun/security/tools/jarsigner Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2009, 2021 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2009, 2025 , Oracle and/or its affiliates. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
@@ -43,8 +43,15 @@ public class ConciseJarsigner {
4343 static OutputAnalyzer kt (String cmd ) throws Exception {
4444 // Choose 2048-bit RSA to make sure it runs fine and fast. In
4545 // fact, every keyalg/keysize combination is OK for this test.
46- return SecurityTools .keytool ("-storepass changeit -keypass changeit "
47- + "-keystore ks -keyalg rsa -keysize 2048 " + cmd );
46+ // The start date is set to -1M to prevent the certificate not yet valid during fast enough execution.
47+ // If -startdate is specified in cmd, cmd version will be used.
48+ if (cmd .contains ("-startdate" )) {
49+ return SecurityTools .keytool ("-storepass changeit -keypass changeit "
50+ + "-keystore ks -keyalg rsa -keysize 2048 " + cmd );
51+ } else {
52+ return SecurityTools .keytool ("-storepass changeit -keypass changeit "
53+ + "-keystore ks -keyalg rsa -keysize 2048 -startdate -1M " + cmd );
54+ }
4855 }
4956
5057 static void gencert (String owner , String cmd ) throws Exception {
You can’t perform that action at this time.
0 commit comments