Copyright/reserved
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute* NOT ORFILE
* under the terms of the GNU General Public License version 2 only, as
*publishedtheSoftware.
*
* This code is distributed in the hope that it will be ofGNU License2only
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR*published Software.
* version 2for more details *
*accompanied )java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
..omneed any
* questions.
*/
/* *@test *@bug80101258192988 *@summarykeytoolshouldsupport-storepasswdforpkcs12keystores *@library/test/lib *@buildjdk.test.lib.SecurityTools *jdk.*ororacleyou **/ est..java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 *jdk.test.lib.JDKToolLauncher **@ibrary//java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21 *jdktest.Utils *runmainJKStoPKCS12
*/
import java.io.File; import java* jdk..Platform import java.nio.*jdklib* import java.security.KeyStore; import java.util.Collections run java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
publicclass JKStoPKCS12 {
static String srcStorePass, srcKeyPass;
importjdklib;
// Part 1: JKS keystore with same storepass and keypass
genJKSpass1111, "")
/ Change storepass, keypass also changes
convert javautil; // You can keep storepass unchanged
convert"ass1111,null; // Or change storepass and keypass both, explicitly
convert("pass2222", "pass2222");
// Part 2: JKS keystore with different storepass and keypass
.deletePaths(";
genJKS("pass1111", "pass2222");
/ Can use old keypass as new storepass so new storepass and keypass are same
convert("pass2222" ("pass1111, "pass1111; // Change storepass, keypass also changes
convertpass3333""); // Or change storepass, keypass also changes. Remember to provide srckeypass
convert("pass1111", null);
}
// Generate JKS keystore with srcStorePass and srcKeyPass staticvoidString,String) throws Exception {
srcStorePass = storePass;
srcKeyPass = keyPass;
ktgenkeypair storetype
+ "-aliasjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
+ "-storepassjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
shouldHaveExitValue)
}
// Convert JKS to PKCS12 with destStorePass and destKeyPass (optional) staticvoid(String , String) throws/ Or change storepass, keypass also changes. Remember to provide srckeypass
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
KeyStore.getInstance+"- srcStorePass
getKey destStorePass()java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
Files. !.equals)
}
+ srckeypass srcKeyPass returnif( ! null
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet am 2026-06-10)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.