undefect. CWE-407 — 63 sites patched across 27 ecosystems

Authors: russell@unturf.com · brackishbert@gmail.com · foxhop.net · TimeHexOn.com

Patches, unit tests, benchmarks, whitepaper, and outreach briefs.
Public domain — no copyright claimed. Use freely.
This commit is contained in:
russell@unturf.com 2026-03-26 17:11:57 -04:00
commit 0a580b313d
70422 changed files with 17213626 additions and 0 deletions

View file

@ -0,0 +1,70 @@
/*
* Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6631361
* @summary Test constructor when PD array is null or contains all null contexts
*/
import java.security.AccessControlContext;
import java.security.ProtectionDomain;
public class CheckCtor {
public static void main(String[] args) throws Exception {
// check that null PD array throws NPE
try {
new AccessControlContext(null);
throw new Exception("Expected NullPointerException not thrown");
} catch (Exception e) {
if (!(e instanceof NullPointerException)) {
throw new Exception("Expected NullPointerException not thrown");
}
}
// check that empty PD array equals PD array of one or more nulls
ProtectionDomain zero[] = {};
ProtectionDomain null1[] = {null};
ProtectionDomain null2[] = {null, null};
AccessControlContext accZero = new AccessControlContext(zero);
AccessControlContext accNull1 = new AccessControlContext(null1);
AccessControlContext accNull2 = new AccessControlContext(null2);
testEquals(accZero, accNull1);
testEquals(accZero, accNull2);
testEquals(accNull1, accNull2);
testEquals(accNull1, accZero);
testEquals(accNull2, accZero);
testEquals(accNull2, accNull1);
}
private static void testEquals(AccessControlContext acc1,
AccessControlContext acc2) throws Exception {
if (!acc1.equals(acc2)) {
throw new Exception("AccessControlContexts should be equal");
}
}
}

View file

@ -0,0 +1,68 @@
/*
* Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import java.security.*;
/*
* @test
* @bug 4250093
* @summary AccessControlContext throws NullPointerException
* if the Combiner is null.
*/
public class NullCombinerEquals {
public static void main(String[] args) throws Exception {
NullCombinerEquals nce = new NullCombinerEquals();
try {
nce.go();
} catch (Exception e) {
throw new Exception("Test Failed: " + e.toString());
}
}
void go() throws Exception {
AccessControlContext acc = AccessController.getContext();
// test both combiners are NULL
acc.equals(acc);
// test one combiner is NULL
AccessControlContext acc2 = new AccessControlContext(acc, new DC());
acc.equals(acc2);
// test other combiner is NULL
acc2.equals(acc);
// test neither combiner is NULL
AccessControlContext acc3 = new AccessControlContext(acc, new DC());
acc2.equals(acc3);
}
private static class DC implements DomainCombiner {
public ProtectionDomain[] combine(ProtectionDomain[] a,
ProtectionDomain[] b) {
// this is irrelevant
return a;
}
}
}

View file

@ -0,0 +1,109 @@
/*
* Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4819194
* @summary doPrivileged should preserve DomainCombiner
*/
import java.security.*;
import java.util.concurrent.Callable;
import javax.security.auth.Subject;
import javax.security.auth.x500.X500Principal;
public class PreserveCombiner {
public static void main(String[] args) throws Exception {
Subject s = new Subject();
s.getPrincipals().add(new X500Principal("cn=duke"));
String result = Subject.callAs(s, new Callable<String>() {
public String call() {
// get subject from current ACC - this always worked
Subject callAsSubject = Subject.current();
if (callAsSubject == null) {
return "test 1 failed";
} else {
System.out.println(callAsSubject);
System.out.println("test 1 passed");
}
// try doPriv (PrivilegedAction) test
String result = AccessController.doPrivilegedWithCombiner
(new PrivilegedAction<String>() {
public String run() {
// get subject after doPriv
Subject doPrivSubject = Subject.current();
if (doPrivSubject == null) {
return "test 2 failed";
} else {
System.out.println(doPrivSubject);
return "test 2 passed";
}
}
});
if ("test 2 failed".equals(result)) {
return result;
} else {
System.out.println(result);
}
// try doPriv (PrivilegedExceptionAction) test
try {
result = AccessController.doPrivilegedWithCombiner
(new PrivilegedExceptionAction<String>() {
public String run() throws PrivilegedActionException {
// get subject after doPriv
Subject doPrivSubject = Subject.current();
if (doPrivSubject == null) {
return "test 3 failed";
} else {
System.out.println(doPrivSubject);
return "test 3 passed";
}
}
});
} catch (PrivilegedActionException pae) {
result = "test 3 failed";
}
if ("test 3 failed".equals(result)) {
return result;
} else {
System.out.println(result);
}
// tests passed
return result;
}
});
if (result.indexOf("passed") <= 0) {
throw new SecurityException("overall test failed");
}
}
}

View file

@ -0,0 +1,61 @@
/*
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import jdk.test.lib.Asserts;
import javax.crypto.spec.DHParameterSpec;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.interfaces.DSAParams;
import java.security.spec.AlgorithmParameterSpec;
import java.security.spec.ECParameterSpec;
import java.security.spec.NamedParameterSpec;
/**
* @test
* @bug 8318096
* @summary Introduce AsymmetricKey interface with a getParams method
* @library /test/lib
*/
public class GetParams {
public static void main(String[] args) throws Exception {
test("DSA", DSAParams.class);
test("RSA", AlgorithmParameterSpec.class);
test("RSASSA-PSS", AlgorithmParameterSpec.class);
test("EC", ECParameterSpec.class);
test("DH", DHParameterSpec.class);
test("EdDSA", NamedParameterSpec.class);
test("XDH", NamedParameterSpec.class);
}
static void test(String alg, Class<? extends AlgorithmParameterSpec> clazz)
throws Exception {
KeyPairGenerator g = KeyPairGenerator.getInstance(alg);
KeyPair kp = g.generateKeyPair();
AlgorithmParameterSpec spec1 = kp.getPrivate().getParams();
Asserts.assertTrue(spec1 == null || clazz.isAssignableFrom(spec1.getClass()));
AlgorithmParameterSpec spec2 = kp.getPublic().getParams();
Asserts.assertTrue(spec2 == null || clazz.isAssignableFrom(spec2.getClass()));
}
}

View file

@ -0,0 +1,125 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 8056179
* @summary Unit test for BasicPermissionCollection subclass
*/
import java.security.BasicPermission;
import java.security.Permission;
import java.security.PermissionCollection;
import java.security.SecurityPermission;
import java.util.Enumeration;
public class BasicPermissionCollection {
public static void main(String[] args) throws Exception {
int testFail = 0;
TestPermission perm = new TestPermission("foo");
PermissionCollection perms = perm.newPermissionCollection();
// test 1
System.out.println("test 1: add throws IllegalArgumentExc");
try {
perms.add(new SecurityPermission("createAccessControlContext"));
System.err.println("Expected IllegalArgumentException");
testFail++;
} catch (IllegalArgumentException iae) {}
// test 2
System.out.println("test 2: implies returns false for wrong class");
if (perms.implies(new SecurityPermission("getPolicy"))) {
System.err.println("Expected false, returned true");
testFail++;
}
// test 3
System.out.println("test 3: implies returns true for match on name");
perms.add(new TestPermission("foo"));
if (!perms.implies(new TestPermission("foo"))) {
System.err.println("Expected true, returned false");
testFail++;
}
// test 4
System.out.println("test 4: implies returns true for wildcard match");
perms.add(new TestPermission("bar.*"));
if (!perms.implies(new TestPermission("bar.foo"))) {
System.err.println("Expected true, returned false");
testFail++;
}
// test 5
System.out.println
("test 5: implies returns false for invalid wildcard");
perms.add(new TestPermission("baz*"));
if (perms.implies(new TestPermission("baz.foo"))) {
System.err.println("Expected false, returned true");
testFail++;
}
// test 6
System.out.println
("test 6: implies returns true for deep wildcard match");
if (!perms.implies(new TestPermission("bar.foo.baz"))) {
System.err.println("Expected true, returned false");
testFail++;
}
// test 7
System.out.println
("test 7: implies returns true for all wildcard match");
perms.add(new TestPermission("*"));
if (!perms.implies(new TestPermission("yes"))) {
System.err.println("Expected true, returned false");
testFail++;
}
// test 8
System.out.println("test 8: elements returns correct number of perms");
int numPerms = 0;
Enumeration<Permission> e = perms.elements();
while (e.hasMoreElements()) {
numPerms++;
System.out.println(e.nextElement());
}
if (numPerms != 4) {
System.err.println("Expected 4, got " + numPerms);
testFail++;
}
if (testFail > 0) {
throw new Exception(testFail + " test(s) failed");
}
}
private static class TestPermission extends BasicPermission {
TestPermission(String name) {
super(name);
}
}
}

View file

@ -0,0 +1,59 @@
/*
* Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4157921
* @summary Test subclasses of BasicPermission to make sure different
* subclasses don't equal or imply each other.
*/
import java.security.Permission;
import java.security.BasicPermission;
class A extends BasicPermission {
public A(String name) { super(name); }
}
class B extends BasicPermission {
public B(String name) { super(name); }
}
public class EqualsImplies {
public static void main(String[]args) throws Exception {
Permission p1 = new A("foo");
Permission p2 = new B("foo");
if (p1.implies(p2) || p2.implies(p1) || p1.equals(p2)) {
throw new Exception("Test failed");
}
// make sure permissions imply and equal themselves
if (! (p1.implies(p1) && p1.equals(p1))) {
throw new Exception("Test failed");
}
}
}

View file

@ -0,0 +1,78 @@
/*
* Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6569218
* @summary Specification of some BasicPermission method does not fit with implementation
*/
import java.security.BasicPermission;
public class ExitVMEquals {
public static void main(String[] args) throws Exception {
BasicPermission bp1 = new BP("exitVM");
BasicPermission bp2 = new BP("exitVM.*");
StringBuffer sb = new StringBuffer();
// First, make sure the old restrictions on exitVM and exitVM.* still hold.
if (!bp1.implies(bp2)) sb.append("bp1 does not implies bp2\n");
if (!bp2.implies(bp1)) sb.append("bp2 does not implies bp1\n");
// Test against hashCode spec
if (bp1.hashCode() != bp1.getName().hashCode())
sb.append("bp1 hashCode not spec consistent\n");
if (bp2.hashCode() != bp2.getName().hashCode())
sb.append("bp2 hashCode not spec consistent\n");
// Test against equals spec
if (bp1.getName().equals(bp2.getName())) {
if (!bp1.equals(bp2)) {
sb.append("BP breaks equals spec\n");
}
}
if (!bp1.getName().equals(bp2.getName())) {
if (bp1.equals(bp2)) {
sb.append("BP breaks equals spec in another way\n");
}
}
// Tests against common knowledge: If equals, then hashCode should be same
if (bp1.equals(bp2)) {
if (bp1.hashCode() != bp2.hashCode()) {
sb.append("Equal objects have unequal hashCode?\n");
}
}
if (sb.length() > 0) {
throw new Exception(sb.toString());
}
}
}
class BP extends BasicPermission {
BP(String name) {
super(name);
}
}

View file

@ -0,0 +1,70 @@
/*
* Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4291610
* @summary BasicPermission.newPermissionCollection collection does not
* enforce homogeneity
*/
import java.security.BasicPermission;
public class Homogeneity {
public static void main(String[] args) {
java.lang.RuntimePermission rp = new java.lang.RuntimePermission
("*");
java.lang.RuntimePermission rp2 = new java.lang.RuntimePermission
("exitVM");
java.net.NetPermission np = new java.net.NetPermission
("setDefaultAuthenticator");
// should be able to add identical BasicPermission subclasses to the
// same collection
java.security.PermissionCollection perms = rp.newPermissionCollection();
try {
perms.add(rp);
perms.add(rp2);
} catch (IllegalArgumentException iae) {
throw new SecurityException("GOOD ADD TEST FAILED");
}
// make sure you can't add different BasicPermission subclasses
// to the same collection
try {
// this should fail
perms.add(np);
throw new SecurityException("BAD ADD TEST FAILED");
} catch (IllegalArgumentException iae) {
// good
}
// make sure a BasicPermissionCollection doesn't imply
// random BasicPermission subclasses
if (perms.implies(np)) {
throw new SecurityException("IMPLIES TEST FAILED");
}
}
}

View file

@ -0,0 +1,39 @@
/*
* Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6568872
* @summary BasicPermission.newPermissionCollection() violates general contract specified in Permission class
*/
public class MixedBasicPermissions {
public static void main(String[] args) {
try {
new java.net.NetPermission("1.1.1.1", "connect").newPermissionCollection().add(new java.util.PropertyPermission("j", "read"));
} catch (Exception e) {
return;
// Correct place
}
throw new RuntimeException("Should not be here");
}
}

View file

@ -0,0 +1,108 @@
/*
* Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4240252
* @summary Make sure BasicPermission constructor raises
* NullPointerException if permission name is null, and
* IllegalArgumentException is permission name is empty.
* @run main/othervm NullOrEmptyName
*/
import java.util.PropertyPermission;
public class NullOrEmptyName {
public static void main(String[]args) throws Exception {
NullOrEmptyName noe = new NullOrEmptyName();
noe.run();
try {
new PropertyPermission(null, "read");
throw new Exception("Expected NullPointerException not thrown");
} catch (NullPointerException npe) {
// expected exception thrown
}
try {
new PropertyPermission("", "read");
throw new Exception("Expected IllegalArgumentException not " +
"thrown");
} catch (IllegalArgumentException iae) {
// expected exception thrown
}
}
void run() throws Exception {
try {
System.getProperty(null);
throw new Exception("Expected NullPointerException not " +
"thrown");
} catch (NullPointerException npe) {
// expected exception thrown
}
try {
System.getProperty(null, "value");
throw new Exception("Expected NullPointerException not " +
"thrown");
} catch (NullPointerException npe) {
// expected exception thrown
}
try {
System.getProperty("");
throw new Exception("Expected IllegalArgumentException not " +
"thrown");
} catch (IllegalArgumentException iae) {
// expected exception thrown
}
try {
System.getProperty("", "value");
throw new Exception("Expected IllegalArgumentException not " +
"thrown");
} catch (IllegalArgumentException iae) {
// expected exception thrown
}
try {
System.setProperty(null, "value");
throw new Exception("Expected NullPointerException not " +
"thrown");
} catch (NullPointerException npe) {
// expected exception thrown
}
try {
System.setProperty("", "value");
throw new Exception("Expected IllegalArgumentException not " +
"thrown");
} catch (IllegalArgumentException iae) {
// expected exception thrown
}
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,126 @@
/*
* Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4511601 7054918
* @summary BasicPermissionCollection does not set permClass
* during deserialization
*/
import java.security.*;
import java.io.*;
public class PermClass {
public static void main(String[] args) throws Exception {
String dir = System.getProperty("test.src");
if (dir == null) {
dir = ".";
}
MyPermission mp = new MyPermission("PermClass");
if (args != null && args.length == 1 && args[0] != null) {
// set up serialized file (arg is JDK version)
PermissionCollection bpc = mp.newPermissionCollection();
bpc.add(mp);
File sFile = new File(dir, "PermClass." + args[0]);
ObjectOutputStream oos = new ObjectOutputStream
(new FileOutputStream("PermClass." + args[0]));
oos.writeObject(bpc);
oos.close();
System.exit(0);
}
// read in a 1.2.1 BasicPermissionCollection
File sFile = new File(dir, "PermClass.1.2.1");
try (FileInputStream fis = new FileInputStream(sFile);
ObjectInputStream ois = new ObjectInputStream(fis)) {
PermissionCollection pc = (PermissionCollection)ois.readObject();
System.out.println("1.2.1 collection = " + pc);
if (pc.implies(mp)) {
System.out.println("JDK 1.2.1 test passed");
} else {
throw new Exception("JDK 1.2.1 test failed");
}
}
// read in a 1.3.1 BasicPermissionCollection
sFile = new File(dir, "PermClass.1.3.1");
try (FileInputStream fis = new FileInputStream(sFile);
ObjectInputStream ois = new ObjectInputStream(fis)) {
PermissionCollection pc = (PermissionCollection)ois.readObject();
System.out.println("1.3.1 collection = " + pc);
if (pc.implies(mp)) {
System.out.println("JDK 1.3.1 test passed");
} else {
throw new Exception("JDK 1.3.1 test failed");
}
}
// read in a 1.4 BasicPermissionCollection
sFile = new File(dir, "PermClass.1.4");
try (FileInputStream fis = new FileInputStream(sFile);
ObjectInputStream ois = new ObjectInputStream(fis)) {
PermissionCollection pc = (PermissionCollection)ois.readObject();
System.out.println("1.4 collection = " + pc);
if (pc.implies(mp)) {
System.out.println("JDK 1.4 test 1 passed");
} else {
throw new Exception("JDK 1.4 test 1 failed");
}
}
// write out current BasicPermissionCollection
PermissionCollection bpc = mp.newPermissionCollection();
bpc.add(mp);
sFile = new File(dir, "PermClass.current");
try (FileOutputStream fos = new FileOutputStream("PermClass.current");
ObjectOutputStream oos = new ObjectOutputStream(fos)) {
oos.writeObject(bpc);
}
// read in current BasicPermissionCollection
try (FileInputStream fis = new FileInputStream("PermClass.current");
ObjectInputStream ois = new ObjectInputStream(fis)) {
PermissionCollection pc = (PermissionCollection)ois.readObject();
System.out.println("current collection = " + pc);
if (pc.implies(mp)) {
System.out.println("JDK 1.4 test 2 passed");
} else {
throw new Exception("JDK 1.4 test 2 failed");
}
}
}
}
class MyPermission extends BasicPermission {
public MyPermission(String name) {
super(name);
}
}

View file

@ -0,0 +1,84 @@
/*
* Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4502729 7054918
* @summary BasicPermissionCollection serial version UID incorrect
*/
import java.security.*;
import java.io.*;
public class SerialVersion {
public static void main(String[] args) throws Exception {
String dir = System.getProperty("test.src");
File sFile = new File (dir,"SerialVersion.1.2.1");
// read in a 1.2.1 BasicPermissionCollection
try (FileInputStream fis = new FileInputStream(sFile);
ObjectInputStream ois = new ObjectInputStream(fis)) {
PermissionCollection pc = (PermissionCollection)ois.readObject();
System.out.println("1.2.1 collection = " + pc);
}
// read in a 1.3.1 BasicPermissionCollection
sFile = new File (dir,"SerialVersion.1.3.1");
try (FileInputStream fis = new FileInputStream(sFile);
ObjectInputStream ois = new ObjectInputStream(fis)) {
PermissionCollection pc = (PermissionCollection)ois.readObject();
System.out.println("1.3.1 collection = " + pc);
}
// read in a 1.4 BasicPermissionCollection
sFile = new File (dir,"SerialVersion.1.4");
try (FileInputStream fis = new FileInputStream(sFile);
ObjectInputStream ois = new ObjectInputStream(fis)) {
PermissionCollection pc = (PermissionCollection)ois.readObject();
System.out.println("1.4 collection = " + pc);
}
// write out current BasicPermissionCollection
MyPermission mp = new MyPermission("SerialVersionTest");
PermissionCollection bpc = mp.newPermissionCollection();
sFile = new File (dir,"SerialVersion.current");
try (FileOutputStream fos = new FileOutputStream("SerialVersion.current");
ObjectOutputStream oos = new ObjectOutputStream(fos)) {
oos.writeObject(bpc);
}
// read in current BasicPermissionCollection
try (FileInputStream fis = new FileInputStream("SerialVersion.current");
ObjectInputStream ois = new ObjectInputStream(fis)) {
PermissionCollection pc = (PermissionCollection)ois.readObject();
System.out.println("current collection = " + pc);
}
}
}
class MyPermission extends BasicPermission {
public MyPermission(String name) {
super(name);
}
}

View file

@ -0,0 +1,54 @@
/*
* Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import java.lang.RuntimePermission;
import java.net.NetPermission;
import java.sql.SQLPermission;
import java.util.PropertyPermission;
import javax.net.ssl.SSLPermission;
/*
* @test
* @bug 7167056
* @summary Check that BasicPermission subclasses don't throw exception if name
* contains wildcard character ("*") but does not signify a
* wildcard match
* @modules java.sql
*/
public class Wildcard {
public static void main(String[] args) throws Exception {
wildcard("*java");
wildcard("java*");
wildcard("ja*va");
}
private static void wildcard(String wildcard) throws Exception {
new RuntimePermission(wildcard);
new NetPermission(wildcard);
new SQLPermission(wildcard);
new PropertyPermission(wildcard, "read");
new SSLPermission(wildcard);
}
}

View file

@ -0,0 +1,68 @@
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* @test
* @bug 6799854
* @summary CodeSigner.hashCode() does not work with serialization
*/
import java.io.*;
import java.security.CodeSigner;
import java.security.Timestamp;
import java.security.cert.*;
import java.util.Collections;
import java.util.Date;
public class Serialize {
public static void main(String[] args) throws Exception {
// Create a certpath consisting of one certificate
File f = new File(System.getProperty("test.src", "."), "cert_file");
FileInputStream fis = new FileInputStream(f);
CertificateFactory cf = CertificateFactory.getInstance("X.509");
Certificate c = cf.generateCertificate(fis);
fis.close();
CertPath cp = cf.generateCertPath(Collections.singletonList(c));
// Create a code signer
CodeSigner cs = new CodeSigner(cp, new Timestamp(new Date(), cp));
// Serialize the code signer
ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
ObjectOutputStream out = new ObjectOutputStream(byteOut);
out.writeObject(cs);
out.close();
// Deserialize the code signer
byte[] data = byteOut.toByteArray();
CodeSigner cs2 = (CodeSigner) new ObjectInputStream(
new ByteArrayInputStream(data)).readObject();
// Test for equality
if (!cs.equals(cs2) || cs.hashCode() != cs2.hashCode()) {
throw new Exception("CodeSigner serialization test FAILED");
}
}
}

Binary file not shown.

View file

@ -0,0 +1,102 @@
/*
* Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6299163
* @summary Test to compare java.security.CodeSource
* Instructions to re-create the used certs file.
* - Generate a self-signed certificate with basicConstraints=CA:TRUE
* - Copy the generated certificate 2 times into a newly created certs file.
*/
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.net.URL;
import java.security.CodeSigner;
import java.security.CodeSource;
import java.security.cert.Certificate;
import java.security.cert.CertificateFactory;
import java.util.ArrayList;
import java.util.List;
public class CertsMatch {
public static void main(String[] args) throws Exception {
File certsFile = new File(System.getProperty("test.src", "."), "certs");
CertificateFactory cf = CertificateFactory.getInstance("X.509");
try (FileInputStream fis = new FileInputStream(certsFile);
BufferedInputStream bis = new BufferedInputStream(fis)) {
ArrayList certs1 = new ArrayList();
ArrayList certs2 = new ArrayList();
// read the first cert
Certificate cert = cf.generateCertificate(bis);
certs1.add(cert);
certs2.add(cert);
// read the second cert
cert = cf.generateCertificate(bis);
certs2.add(cert);
URL location = certsFile.toURI().toURL();
CodeSource cs0 = new CodeSource(location, (Certificate[]) null);
CodeSource cs1 = new CodeSource(location,
(Certificate[]) certs1.toArray(new Certificate[certs1.size()]));
CodeSource cs2 = new CodeSource(location,
(Certificate[]) certs2.toArray(new Certificate[certs2.size()]));
if (!cs0.implies(cs1) || !cs1.implies(cs2)) {
throw new Exception("The implies method is not working correctly");
}
if (cs0.equals(cs1) || cs1.equals(cs0)
|| cs2.equals(cs1) || cs1.equals(cs2)) {
throw new Exception("The equals method is not working correctly");
}
if (verifySigner(cs0.getCodeSigners(), null)) {
throw new RuntimeException("CodeSource.getCodeSigners() should be null");
}
if (!((verifySigner(cs1.getCodeSigners(), certs1))
&& (verifySigner(cs2.getCodeSigners(), certs2)))) {
throw new RuntimeException("Mismatched CodeSigners certificate");
}
}
}
private static boolean verifySigner(CodeSigner[] css, List certs) {
if (css == null || certs == null) {
return false;
}
if (css.length < 1 || certs.size() < 1) {
return false;
}
boolean result = true;
for (CodeSigner cs : css) {
result &= cs.getSignerCertPath().getCertificates().equals(certs);
}
return result;
}
}

View file

@ -0,0 +1,110 @@
/*
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import java.security.CodeSigner;
import java.security.CodeSource;
import java.security.PublicKey;
import java.security.cert.Certificate;
/**
* @test
* @bug 8366522
* @summary Verify that getCertificates() and getCodeSigners() return correct
* results when CodeSource is created with empty or null Certificate[]
* or CodeSigner[] arguments, or there are no X509 certificates in
* certs. Make sure that NPE is not thrown from
* CodeSource.getCodeSigners()
*/
public class CodeSourceNoInputs {
private static final Certificate NON_X509_CERT = new Certificate("") {
@Override
public byte[] getEncoded() {
return new byte[0];
}
@Override
public void verify(PublicKey key) {
}
@Override
public void verify(PublicKey key, String sigProvider) {
}
@Override
public String toString() {
return "";
}
@Override
public PublicKey getPublicKey() {
return null;
}
};
public static void main(String[] args) throws Exception {
CodeSource cs;
cs = new CodeSource(null, (Certificate[]) null);
if (cs.getCodeSigners() != null || cs.getCertificates() != null) {
throw new SecurityException("Both CodeSource.getCodeSigners() " +
"and CodeSource.getCertificates() should return null for " +
"new CodeSource(null, (Certificate[]) null)");
}
cs = new CodeSource(null, (CodeSigner[]) null);
if (cs.getCodeSigners() != null || cs.getCertificates() != null) {
throw new SecurityException("Both CodeSource.getCodeSigners() " +
"and CodeSource.getCertificates() should return null for " +
"new CodeSource(null, (CodeSigners[]) null)");
}
cs = new CodeSource(null, new Certificate[0]);
if (cs.getCodeSigners().length != 0
|| cs.getCertificates().length != 0) {
throw new SecurityException("Both CodeSource.getCodeSigners()" +
"and CodeSource.getCertificates() should return empty arrays " +
"for new CodeSource(null, new Certificate[0])");
}
cs = new CodeSource(null, new CodeSigner[0]);
if (cs.getCodeSigners().length != 0
|| cs.getCertificates().length != 0) {
throw new SecurityException("Both CodeSource.getCodeSigners() and" +
" CodeSource.getCertificates() should return empty arrays for" +
" new CodeSource(null, new CodeSigners[0])");
}
cs = new CodeSource(null, new Certificate[]{NON_X509_CERT});
if (cs.getCodeSigners().length != 0 || cs.getCertificates() == null) {
throw new SecurityException("Both CodeSource.getCodeSigners() and" +
" CodeSource.getCertificates() should return arrays for new" +
" CodeSource(null, new CodeSigners[1]{NON-X509-CERTIFICATE})");
}
}
}

View file

@ -0,0 +1,103 @@
/*
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4866847 7152564 7155693 8356557
* @summary various CodeSource.implies tests
*/
import java.security.CodeSource;
import java.net.InetAddress;
import java.net.URL;
public class Implies {
public static void main(String[] args) throws Exception {
URL thisURL = new URL("http", "localhost", "file");
URL thatURL = new URL("http", null, "file");
// should not throw NullPointerException
testImplies(thisURL, thatURL, false);
thisURL = new URL("http", "localhost", "dir/-");
thatURL = new URL("HTTP", "localhost", "dir/file");
// protocol check should ignore case
testImplies(thisURL, thatURL, true);
thisURL = new URL("http", "localhost", 80, "dir/-");
thatURL = new URL("HTTP", "localhost", "dir/file");
// port check should match default port of thatURL
testImplies(thisURL, thatURL, true);
thisURL = new URL("http", "204.160.241.0", "file");
thatURL = new URL("http", "localhost", "file");
// ip address should not imply localhost's IP address
testImplies(thisURL, thatURL, false);
thisURL = new URL("http", "204.160.241.0", "file");
thatURL = new URL("http", "*.example.com", "file");
// ip address should not imply wildcarded host
testImplies(thisURL, thatURL, false);
InetAddress ia = InetAddress.getLocalHost();
thisURL = new URL("http", ia.getHostAddress(), "file");
thatURL = new URL("http", ia.getHostName(), "file");
// ip address should imply host name with same ip address
testImplies(thisURL, thatURL, true);
thisURL = new URL("http", "*.example.com", "file");
thatURL = new URL("http", "*.foo.example.com", "file");
// wildcarded host name should imply wildcarded host name ending with
// same canonical host name
testImplies(thisURL, thatURL, true);
thisURL = new URL("http", "example.com", "file");
thatURL = new URL("http", "*.foo.example.com", "file");
// host name should not imply wildcarded host name ending with same
// canonical host name
testImplies(thisURL, thatURL, false);
thisURL = new URL("http", "*.example.com", "file");
thatURL = new URL("http", "foo.example.com", "file");
// wildcarded host name should imply host name ending with same
// canonical host name
testImplies(thisURL, thatURL, true);
System.out.println("test passed");
}
private static void testImplies(URL thisURL, URL thatURL, boolean result)
throws SecurityException {
CodeSource thisCs
= new CodeSource(thisURL, (java.security.cert.Certificate[]) null);
CodeSource thatCs
= new CodeSource(thatURL, (java.security.cert.Certificate[]) null);
if (thisCs.implies(thatCs) != result) {
throw new SecurityException("CodeSource.implies() returned "
+ !result + " instead of " + result);
}
if (thisCs.getCodeSigners() != null && thatCs.getCodeSigners() != null) {
throw new SecurityException("Both getCodeSigners should be null");
}
}
}

View file

@ -0,0 +1,42 @@
-----BEGIN CERTIFICATE-----
MIIDgzCCAmugAwIBAgIJALi3XHB1pDxTMA0GCSqGSIb3DQEBCwUAMFgxCzAJBgNV
BAYTAlVTMQ0wCwYDVQQIDAR0ZXN0MQ0wCwYDVQQHDAR0ZXN0MQ0wCwYDVQQKDAR0
ZXN0MQ0wCwYDVQQLDAR0ZXN0MQ0wCwYDVQQDDAR0ZXN0MB4XDTIyMDYwODA3Mzkz
MFoXDTQ3MDYwMjA3MzkzMFowWDELMAkGA1UEBhMCVVMxDTALBgNVBAgMBHRlc3Qx
DTALBgNVBAcMBHRlc3QxDTALBgNVBAoMBHRlc3QxDTALBgNVBAsMBHRlc3QxDTAL
BgNVBAMMBHRlc3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCUfQUR
jdnE1KyZKjPoL2np9T9grBJFaApt1oxNOXLzOW19EYUbbmzERKf9bHALfYIRZonj
wYEywWMLxVuM1YdJAKO2X/X2nvPZLmi9BPVa0aGyG/X19L9FKXEKugzujrq2gko0
ryDpV1Rrbqpv5G9wXA1+jzPVteFgCX9IoNLEatXVAN8gfnuOCvAM83VMit91+LNs
uK9Eo9xcPyVt0n7Tl+VtW/nVzlRz/p6xHIB0Uo3Dl//QziMllWng98TCxtcTvOBd
gl1AlTAwFWGwQRL2xC8iFrJ5vgY4/afth68W0pqsIH5TCJumGVf/0VBYIs+OWdyT
Wu0Eswjx34gsuvyTAgMBAAGjUDBOMB0GA1UdDgQWBBRmeQRExt2gPyc+b6fB8hL8
+oiT+jAfBgNVHSMEGDAWgBRmeQRExt2gPyc+b6fB8hL8+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IB0Uo3Dl//QziMllWng98TCxtcTvOBd
gl1AlTAwFWGwQRL2xC8iFrJ5vgY4/afth68W0pqsIH5TCJumGVf/0VBYIs+OWdyT
Wu0Eswjx34gsuvyTAgMBAAGjUDBOMB0GA1UdDgQWBBRmeQRExt2gPyc+b6fB8hL8
+oiT+jAfBgNVHSMEGDAWgBRmeQRExt2gPyc+b6fB8hL8+oiT+jAMBgNVHRMEBTAD
AQH/MA0GCSqGSIb3DQEBCwUAA4IBAQCRlgYqBPXnrhHySR0GzTG2eSQ2B6MqLTOX
nt10kmp92zFJ/AZIoHZGyNC45dRXLX1ZcV8dtAKzbZLo2u07TGxM/q66bHOpXbCn
FGZqyhanDrkwHWPI58pyDuzRKUQKq+kuwpctDiZpjVBcZIVP/ecZcI0DO7qKWEXc
JVXgfkqjU0PMCQDpahDuPLQ3otYDUgNAY82c4WETypjTE8GaLCg++JmPy0Yo8kR4
VBabOgp4FJi+DDo7VNZRuCTZG91pNlKUZNnR/T1VO0KPtbJoRV5XBRcwdCfhtxNW
lK33pqJx7xAY5Gkg+SdvQOA0d4y6YbCF7eO1QyA5x+dqq+YGHpw7
-----END CERTIFICATE-----

View file

@ -0,0 +1,66 @@
/*
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import jdk.test.lib.Asserts;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.nio.charset.StandardCharsets;
import java.security.DigestInputStream;
import java.security.MessageDigest;
/**
* @test
* @bug 6587699
* @summary Document DigestInputStream behavior when skip() or mark() / reset() is used
* @library /test/lib
*/
public class TestSkipAndReset {
public static void main(String[] args) throws Exception {
byte[] data = "1234567890".getBytes(StandardCharsets.UTF_8);
MessageDigest md = MessageDigest.getInstance("SHA-256");
DigestInputStream dis = new DigestInputStream(new ByteArrayInputStream(data), md);
dis.read(); // read 1
dis.read(new byte[2], 0, 1); // read 2
dis.skip(3); // skip 3 4 5
dis.mark(10); // remember 5
dis.read(new byte[2]); // read 6 7
dis.skip(1); // skip 8
dis.read(); // read 9
dis.reset(); // back to 5
dis.readNBytes(3); // read 6 7 8
dis.reset(); // back to 5
dis.skip(2); // skip 6 7
dis.readAllBytes(); // read 8 9 0
dis.reset(); // back to 5
dis.skip(3); // skip 6 7 8
dis.transferTo(new ByteArrayOutputStream()); // read 9 0
byte[] hash = md.digest();
byte[] directHash = md.digest("1267967889090".getBytes(StandardCharsets.UTF_8));
Asserts.assertTrue(MessageDigest.isEqual(hash, directHash));
}
}

View file

@ -0,0 +1,72 @@
/*
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4496095 8296406
* @summary Test constructors for exception chaining of security-related exceptions
*/
import java.security.*;
import java.security.cert.*;
import java.security.spec.*;
import javax.net.ssl.*;
public class ChainingConstructors {
private static final String MSG = "msg";
private static Exception cause = new Exception("cause");
public static <E extends Exception> void test(E ex1, E ex2) throws Exception {
String cln = ex1.getClass().getSimpleName();
if (!ex1.getCause().equals(cause)) {
throw new SecurityException("Cause test failed for " + cln);
}
if (!ex2.getMessage().equals(MSG) || !ex2.getCause().equals(cause)) {
throw new SecurityException("Cause and message test failed for " + cln);
}
}
public static void main(String[] args) throws Exception {
test(new SecurityException(cause), new SecurityException(MSG, cause));
test(new DigestException(cause), new DigestException(MSG, cause));
test(new GeneralSecurityException(cause), new GeneralSecurityException(MSG, cause));
test(new InvalidAlgorithmParameterException(cause),
new InvalidAlgorithmParameterException(MSG, cause));
test(new InvalidKeyException(cause), new InvalidKeyException(MSG, cause));
test(new InvalidKeySpecException(cause), new InvalidKeySpecException(MSG, cause));
test(new InvalidParameterException(cause), new InvalidParameterException(MSG, cause));
test(new KeyException(cause), new KeyException(MSG, cause));
test(new KeyManagementException(cause), new KeyManagementException(MSG, cause));
test(new KeyStoreException(cause), new KeyStoreException(MSG, cause));
test(new NoSuchAlgorithmException(cause), new NoSuchAlgorithmException(MSG, cause));
test(new ProviderException(cause), new ProviderException(MSG, cause));
test(new SignatureException(cause), new SignatureException(MSG, cause));
test(new CRLException(cause), new CRLException(MSG, cause));
test(new CertificateException(cause), new CertificateException(MSG, cause));
test(new CertificateParsingException(cause), new CertificateParsingException(MSG, cause));
test(new CertificateEncodingException(cause), new CertificateEncodingException(MSG, cause));
test(new CertPathBuilderException(cause), new CertPathBuilderException(MSG, cause));
test(new SSLException(cause), new SSLException(MSG, cause));
}
}

View file

@ -0,0 +1,146 @@
/*
* Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @author Gary Ellison
* @bug 4183136
* @summary java.security.Identity violates equals/hashCode contract
*/
import java.security.*;
import java.io.*;
public class EqualsHashCodeContract
{
public static void main(String args[]) throws Exception {
Identity i1=new MyIdentity("identity",
new MyIdentityScope("IdentityScope"));
Identity i2=new MyIdentity("identity",
new MyIdentityScope("IdentityScope"));
Identity i3=new MyIdentity("identity",
new MyIdentityScope(""));
PublicKey pk1=new MyPublicKey();
PublicKey pk2=new MyPublicKey();
if ( !(i1.equals(i2)) == (i1.hashCode()==i2.hashCode()) ) {
System.err.println("FAILED");
Exception up = new
Exception("Contract violated -- same name and same scope");
throw up;
}
System.out.println("Test same name, same scope........... PASSED");
i1.setPublicKey(pk1);
i3.setPublicKey(pk1);
if ( !((i1.equals(i3)) && (i1.hashCode()==i3.hashCode()))) {
System.err.println("FAILED");
Exception up = new Exception("Contract violated -- PublicKeys do not differ");
throw up;
}
System.out.println("Test same name, same PublicKeys ..... PASSED");
System.out.println("TEST PASSED");
}
}
class MyIdentity extends Identity {
public MyIdentity(String name, IdentityScope is) throws KeyManagementException {
super(name, is);
}
}
class MyPublicKey implements PublicKey, Certificate {
private byte e[] = null;
public String getAlgorithm() {
return null;
}
public String getFormat() {
return new String("PKCS15");
}
public byte[] getEncoded() {
if (e == null) {
ByteArrayOutputStream bs = new ByteArrayOutputStream();
DataOutputStream ds = new DataOutputStream(bs);
try {
ds.writeLong(System.currentTimeMillis());
} catch (IOException ioe) {
ioe.printStackTrace();
}
e = bs.toByteArray();
}
return e;
}
public void decode(InputStream stream) {
}
public void encode(OutputStream stream) {
}
public Principal getGuarantor() {
return null;
}
public Principal getPrincipal() {
return null;
}
public PublicKey getPublicKey() {
return this;
}
public String toString(boolean detailed) {
return null;
}
}
class MyIdentityScope extends IdentityScope {
public MyIdentityScope(String name) {
super(name);
}
public int size() {
return 0;
}
public Identity getIdentity(String name) {
return null;
}
public Identity getIdentity(PublicKey key) {
return null;
}
public void addIdentity(Identity identity) {
}
public void removeIdentity(Identity identity) {
}
public java.util.Enumeration identities() {
return null;
}
}

View file

@ -0,0 +1,42 @@
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6921001
* @summary The default system identity scope is now null.
*/
import java.security.*;
public class NoDefaultSystemScope {
public static void main(String args[]) throws Exception {
IdentityScope s = IdentityScope.getSystemScope();
if (s != null) {
throw new Exception("The default system scope should be null");
}
System.out.println("TEST PASSED");
}
}

View file

@ -0,0 +1,79 @@
/*
* Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 8189441
* @library /test/lib /test/jdk/sun/security/pkcs11
* @summary make sure Generic is accepted by all KeyAgreement implementations
* @run main Generic builtin
* @run main/othervm Generic nss
* @run main/othervm -DCUSTOM_P11_CONFIG_NAME=p11-nss-sensitive.txt Generic nss
*/
import jdk.test.lib.Asserts;
import javax.crypto.KeyAgreement;
import java.security.KeyPairGenerator;
import java.security.Provider;
import java.security.Security;
import java.util.List;
public class Generic {
public static void main(String[] args) throws Exception {
if (args[0].equals("nss")) {
test(PKCS11Test.getSunPKCS11(PKCS11Test.getNssConfig()));
} else {
for (var p : Security.getProviders()) {
test(p);
}
}
}
static void test(Provider p) throws Exception {
for (var s : p.getServices()) {
if (s.getType().equalsIgnoreCase("KeyAgreement")) {
try {
System.out.println(s.getProvider().getName() + "." + s.getAlgorithm());
var g = KeyPairGenerator.getInstance(ka2kpg(s.getAlgorithm()), p);
var kp1 = g.generateKeyPair();
var kp2 = g.generateKeyPair();
var ka = KeyAgreement.getInstance(s.getAlgorithm(), s.getProvider());
for (var alg : List.of("TlsPremasterSecret", "Generic")) {
ka.init(kp1.getPrivate());
ka.doPhase(kp2.getPublic(), true);
Asserts.assertEquals(
ka.generateSecret(alg).getAlgorithm(), alg);
}
} catch (Exception e) {
throw e;
}
}
}
}
// Find key algorithm from KeyAgreement algorithm
private static String ka2kpg(String ka) {
return ka.equals("ECDH") ? "EC" : ka;
}
}

View file

@ -0,0 +1,156 @@
/*
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4936763 8184359 8205476 8226307
* @summary KeyAgreement Test with all supported algorithms from JCE.
* Arguments order <KeyExchangeAlgorithm> <KeyGenAlgorithm> <Provider>
* It removes com/sun/crypto/provider/KeyAgreement/DHGenSecretKey.java
* as the same functionality for DiffieHellman is covered along with
* this test file was covered before with JDK-4936763.
* @run main/othervm -Djdk.crypto.KeyAgreement.legacyKDF=true KeyAgreementTest
* DiffieHellman DH SunJCE
* @run main KeyAgreementTest ECDH EC SunEC
* @run main KeyAgreementTest XDH XDH SunEC
*/
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.spec.NamedParameterSpec;
import java.security.spec.AlgorithmParameterSpec;
import java.security.spec.ECGenParameterSpec;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.crypto.KeyAgreement;
import javax.crypto.spec.DHGenParameterSpec;
public class KeyAgreementTest {
public static void main(String[] args) throws Exception {
String kaAlgo = args[0];
String kpgAlgo = args[1];
String provider = System.getProperty("test.provider.name", args[2]);
System.out.println("Testing " + kaAlgo);
AlgoSpec aSpec = AlgoSpec.valueOf(AlgoSpec.class, kaAlgo);
List<AlgorithmParameterSpec> specs = aSpec.getAlgorithmParameterSpecs();
for (AlgorithmParameterSpec spec : specs) {
testKeyAgreement(provider, kaAlgo, kpgAlgo, spec);
}
}
/**
* Generate AlgorithmParameterSpec using all possible supported curve for
* KeyExchangeAlgorithm.
*/
private enum AlgoSpec {
// EC curve supported for KeyGeneration can found between intersection
// of curves define in
// "java.base/share/classes/sun/security/util/CurveDB.java"
ECDH("secp256r1", "secp384r1", "secp521r1"),
XDH("X25519", "X448", "x25519"),
// There is no curve for DiffieHellman
DiffieHellman(new String[]{});
private final List<AlgorithmParameterSpec> specs = new ArrayList<>();
private AlgoSpec(String... curves) {
// Generate AlgorithmParameterSpec for each KeyExchangeAlgorithm
for (String crv : curves) {
switch (this.name()) {
case "ECDH":
specs.add(new ECGenParameterSpec(crv));
break;
case "XDH":
specs.add(new NamedParameterSpec(crv));
break;
case "DiffieHellman":
specs.add(new DHGenParameterSpec(512, 64));
break;
default:
throw new RuntimeException("Invalid Algo name "
+ this.name());
}
}
}
public List<AlgorithmParameterSpec> getAlgorithmParameterSpecs() {
return this.specs;
}
}
/**
* Perform KeyAgreement operation
*/
private static void testKeyAgreement(String provider, String kaAlgo,
String kpgAlgo, AlgorithmParameterSpec spec) throws Exception {
KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgo, provider);
kpg.initialize(spec);
if (spec instanceof ECGenParameterSpec) {
System.out.println("Testing curve: " +
((ECGenParameterSpec)spec).getName());
} else if (spec instanceof NamedParameterSpec) {
System.out.println("Testing curve: " +
((NamedParameterSpec)spec).getName());
}
KeyPair kp1 = kpg.generateKeyPair();
KeyPair kp2 = kpg.generateKeyPair();
// Uses KeyAgreement based on Provider search order.
KeyAgreement ka1 = KeyAgreement.getInstance(kaAlgo);
ka1.init(kp1.getPrivate());
ka1.doPhase(kp2.getPublic(), true);
byte[] secret1 = ka1.generateSecret();
// Uses SunJCE provider
KeyAgreement ka2 = KeyAgreement.getInstance(kaAlgo, provider);
ka2.init(kp2.getPrivate());
ka2.doPhase(kp1.getPublic(), true);
// Keeping the legacy generateSecret method for DiffieHellman as it was
// defined in removed Test file from JDK-4936763,
// com/sun/crypto/provider/KeyAgreement/DHGenSecretKey.java.
byte[] secret2 = "DiffieHellman".equals(kaAlgo)
? ka2.generateSecret("AES").getEncoded() : ka2.generateSecret();
// With related keypairs, each provider should generate same
// KeyAgreement secret.
if (!Arrays.equals(secret1, secret2)) {
throw new Exception("KeyAgreement secret mismatch.");
}
// ensure that a new secret cannot be produced before the next doPhase
try {
ka2.generateSecret();
throw new RuntimeException("state not reset");
} catch (IllegalStateException ex) {
// this is expected
}
// calling doPhase and then generateSecret should succeed
ka2.doPhase(kp1.getPublic(), true);
ka2.generateSecret();
}
}

View file

@ -0,0 +1,237 @@
/*
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 8184359
* @summary KeyLength support test for DiffieHellman, EC, XDH.
* Arguments order <KeyExchangeAlgorithm> <Provider> <KeyGenAlgorithm> <keyLen>
* @library /test/lib
* @run main KeySizeTest DiffieHellman SunJCE DiffieHellman 512
* @run main KeySizeTest DiffieHellman SunJCE DiffieHellman 768
* @run main KeySizeTest DiffieHellman SunJCE DiffieHellman 832
* @run main KeySizeTest DiffieHellman SunJCE DiffieHellman 1024
* @run main KeySizeTest DiffieHellman SunJCE DiffieHellman 2048
* @run main KeySizeTest DiffieHellman SunJCE DiffieHellman 3072
* @run main KeySizeTest DiffieHellman SunJCE DiffieHellman 4096
* @run main KeySizeTest DiffieHellman SunJCE DiffieHellman 6144
* @run main KeySizeTest DiffieHellman SunJCE DiffieHellman 8192
* @run main/othervm KeySizeTest ECDH SunEC EC 256
* @run main/othervm KeySizeTest ECDH SunEC EC 384
* @run main/othervm KeySizeTest ECDH SunEC EC 521
* @run main KeySizeTest XDH SunEC XDH 255
* @run main KeySizeTest XDH SunEC XDH 448
*/
import java.math.BigInteger;
import java.security.KeyFactory;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.interfaces.ECPrivateKey;
import java.security.interfaces.ECPublicKey;
import java.security.interfaces.XECPrivateKey;
import java.security.interfaces.XECPublicKey;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
import java.security.spec.NamedParameterSpec;
import java.util.Arrays;
import java.util.HexFormat;
import javax.crypto.KeyAgreement;
import javax.crypto.interfaces.DHPrivateKey;
import javax.crypto.interfaces.DHPublicKey;
public class KeySizeTest {
public static void main(String[] args) throws Exception {
String kaAlgo = args[0];
String provider = System.getProperty("test.provider.name", args[1]);
String kpgAlgo = args[2];
int keySize = Integer.parseInt(args[3]);
testKeyAgreement(provider, kaAlgo, kpgAlgo, keySize);
}
/**
* Perform KeyAgreement operation.
*/
private static void testKeyAgreement(String provider, String kaAlgo,
String kpgAlgo, int keySize) throws Exception {
KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgo, provider);
kpg.initialize(keySize);
KeyPair kp = kpg.generateKeyPair();
// Test standard Key attributes.
testKeyAttributes(provider, kpgAlgo, kp, keySize);
// Test KeyAgreement.
KeyAgreement ka = KeyAgreement.getInstance(kaAlgo, provider);
ka.init(kp.getPrivate());
ka.doPhase(kp.getPublic(), true);
ka.generateSecret();
}
/**
* Test standard Key attributes.
*/
private static void testKeyAttributes(String provider, String kpgAlgo,
KeyPair kp, int keySize) throws Exception {
KeyFactory kf = KeyFactory.getInstance(kpgAlgo, provider);
switch (kpgAlgo) {
case "DiffieHellman":
// Verify PrivateKey attributes.
DHPrivateKey dhPri = (DHPrivateKey) kp.getPrivate();
BigInteger p = dhPri.getParams().getP();
if (p.bitLength() != keySize) {
throw new Exception(String.format("Invalid modulus size: "
+ "%s/%s", p.bitLength(), keySize));
}
if (!p.isProbablePrime(128)) {
throw new Exception("The modulus is composite!");
}
PKCS8EncodedKeySpec dhPriSpec
= new PKCS8EncodedKeySpec(dhPri.getEncoded());
DHPrivateKey dhPriDecod
= (DHPrivateKey) kf.generatePrivate(dhPriSpec);
equals(dhPri.getX(), dhPriDecod.getX());
equals(dhPri.getFormat(), dhPriDecod.getFormat());
equals(dhPri.getEncoded(), dhPriDecod.getEncoded());
equals(dhPri.getParams().getG(), dhPriDecod.getParams().getG());
equals(dhPri.getParams().getL(), dhPriDecod.getParams().getL());
equals(dhPri.getParams().getP(), dhPriDecod.getParams().getP());
// Verify PublicKey attributes.
DHPublicKey dhPub = (DHPublicKey) kp.getPublic();
p = dhPub.getParams().getP();
if (p.bitLength() != keySize) {
throw new Exception(String.format("Invalid modulus size: "
+ "%s/%s", p.bitLength(), keySize));
}
X509EncodedKeySpec dhPubSpec
= new X509EncodedKeySpec(dhPub.getEncoded());
DHPublicKey dhPubDecod
= (DHPublicKey) kf.generatePublic(dhPubSpec);
equals(dhPub.getY(), dhPubDecod.getY());
equals(dhPub.getFormat(), dhPubDecod.getFormat());
equals(dhPub.getEncoded(), dhPubDecod.getEncoded());
equals(dhPub.getParams().getG(), dhPubDecod.getParams().getG());
equals(dhPub.getParams().getL(), dhPubDecod.getParams().getL());
equals(dhPub.getParams().getP(), dhPubDecod.getParams().getP());
BigInteger left = BigInteger.ONE;
BigInteger right = p.subtract(BigInteger.ONE);
BigInteger x = dhPri.getX();
if ((x.compareTo(left) <= 0) || (x.compareTo(right) >= 0)) {
throw new Exception(
"X outside range [2, p - 2]: x: " + x + " p: " + p);
}
BigInteger y = dhPub.getY();
if ((y.compareTo(left) <= 0) || (y.compareTo(right) >= 0)) {
throw new Exception(
"Y outside range [2, p - 2]: x: " + x + " p: " + p);
}
break;
case "EC":
// Verify PrivateKey attributes.
ECPrivateKey ecPriv = (ECPrivateKey) kp.getPrivate();
PKCS8EncodedKeySpec ecPriSpec
= new PKCS8EncodedKeySpec(ecPriv.getEncoded());
ECPrivateKey ecPriDecod
= (ECPrivateKey) kf.generatePrivate(ecPriSpec);
equals(ecPriv.getS(), ecPriDecod.getS());
equals(ecPriv.getFormat(), ecPriDecod.getFormat());
equals(ecPriv.getEncoded(), ecPriDecod.getEncoded());
equals(ecPriv.getParams().getCofactor(),
ecPriDecod.getParams().getCofactor());
equals(ecPriv.getParams().getCurve(),
ecPriDecod.getParams().getCurve());
equals(ecPriv.getParams().getGenerator(),
ecPriDecod.getParams().getGenerator());
equals(ecPriv.getParams().getOrder(),
ecPriDecod.getParams().getOrder());
// Verify PublicKey attributes.
ECPublicKey ecPub = (ECPublicKey) kp.getPublic();
X509EncodedKeySpec ecPubSpec
= new X509EncodedKeySpec(ecPub.getEncoded());
ECPublicKey ecPubDecod
= (ECPublicKey) kf.generatePublic(ecPubSpec);
equals(ecPub.getW(), ecPubDecod.getW());
equals(ecPub.getFormat(), ecPubDecod.getFormat());
equals(ecPub.getEncoded(), ecPubDecod.getEncoded());
equals(ecPub.getParams().getCofactor(),
ecPubDecod.getParams().getCofactor());
equals(ecPub.getParams().getCurve(),
ecPubDecod.getParams().getCurve());
equals(ecPub.getParams().getGenerator(),
ecPubDecod.getParams().getGenerator());
equals(ecPub.getParams().getOrder(),
ecPubDecod.getParams().getOrder());
break;
case "XDH":
// Verify PrivateKey attributes.
XECPrivateKey xdhPri = (XECPrivateKey) kp.getPrivate();
PKCS8EncodedKeySpec xdhPriSpec
= new PKCS8EncodedKeySpec(xdhPri.getEncoded());
XECPrivateKey xdhPriDec
= (XECPrivateKey) kf.generatePrivate(xdhPriSpec);
equals(xdhPri.getScalar().get(), xdhPriDec.getScalar().get());
equals(xdhPri.getFormat(), xdhPriDec.getFormat());
equals(xdhPri.getEncoded(), xdhPriDec.getEncoded());
equals(((NamedParameterSpec) xdhPri.getParams()).getName(),
((NamedParameterSpec) xdhPriDec.getParams()).getName());
// Verify PublicKey attributes.
XECPublicKey xdhPub = (XECPublicKey) kp.getPublic();
X509EncodedKeySpec xdhPubSpec
= new X509EncodedKeySpec(xdhPub.getEncoded());
XECPublicKey xdhPubDec
= (XECPublicKey) kf.generatePublic(xdhPubSpec);
equals(xdhPub.getU(), xdhPubDec.getU());
equals(xdhPub.getFormat(), xdhPubDec.getFormat());
equals(xdhPub.getEncoded(), xdhPubDec.getEncoded());
equals(((NamedParameterSpec) xdhPub.getParams()).getName(),
((NamedParameterSpec) xdhPubDec.getParams()).getName());
break;
default:
throw new RuntimeException("Invalid Algo name " + kpgAlgo);
}
}
private static boolean equals(Object actual, Object expected) {
boolean equals = actual.equals(expected);
if (!equals) {
throw new RuntimeException(String.format("Actual: %s, Expected: %s",
actual, expected));
}
return equals;
}
private static boolean equals(byte[] actual, byte[] expected) {
boolean equals = Arrays.equals(actual, expected);
if (!equals) {
throw new RuntimeException(String.format("Actual array: %s, Expected array:%s",
HexFormat.of().withUpperCase().formatHex(actual),
HexFormat.of().withUpperCase().formatHex(expected)));
}
return equals;
}
}

View file

@ -0,0 +1,318 @@
/*
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 8184359
* @library /test/lib
* @summary Standard tests on KeySpec, KeyFactory, KeyPairs and Keys.
* Arguments order <KeyExchangeAlgorithm> <Provider> <KeyGenAlgorithm> <Curve*>
* @run main KeySpecTest DiffieHellman SunJCE DiffieHellman
* @run main KeySpecTest ECDH SunEC EC
* @run main KeySpecTest XDH SunEC XDH X25519
* @run main KeySpecTest XDH SunEC XDH X448
*/
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.security.KeyFactory;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.spec.ECPrivateKeySpec;
import java.security.spec.ECPublicKeySpec;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
import java.security.spec.NamedParameterSpec;
import java.security.spec.XECPublicKeySpec;
import java.security.spec.XECPrivateKeySpec;
import java.security.spec.KeySpec;
import java.util.ArrayList;
import java.util.List;
import java.util.Arrays;
import javax.crypto.KeyAgreement;
import javax.crypto.spec.DHPrivateKeySpec;
import javax.crypto.spec.DHPublicKeySpec;
import jdk.test.lib.security.SecurityUtils;
public class KeySpecTest {
public static void main(String[] args) throws Exception {
String kaAlgo = args[0];
String provider = System.getProperty("test.provider.name", args[1]);
String kpgAlgo = args[2];
KeyPair kp = genKeyPair(provider, kpgAlgo,
(args.length > 3) ? args[3] : kpgAlgo);
testKeySpecs(provider, kaAlgo, kpgAlgo, kp);
testEncodedKeySpecs(provider, kaAlgo, kpgAlgo, kp);
}
/**
* Generate keyPair based on KeyPairGenerator algorithm.
*/
private static KeyPair genKeyPair(String provider, String kpgAlgo,
String kpgInit) throws Exception {
KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgo, provider);
switch (kpgInit) {
case "DiffieHellman":
kpg.initialize(SecurityUtils.getTestKeySize(kpgInit));
break;
case "EC":
kpg.initialize(256);
break;
case "X25519":
kpg.initialize(255);
break;
case "X448":
kpg.initialize(448);
break;
default:
throw new RuntimeException("Invalid Algo name " + kpgInit);
}
return kpg.generateKeyPair();
}
/**
* Standard Test with Keys and the one generated through Spec.
*/
private static void testKeySpecs(String provider, String kaAlgo,
String kpgAlgo, KeyPair kp) throws Exception {
KeyFactory kf = KeyFactory.getInstance(kpgAlgo, provider);
// For each public KeySpec supported by KeyPairGenerator
for (Class pubSpecType
: getCompatibleKeySpecs(kpgAlgo, KeyType.PUBLIC)) {
//For each private KeySpec supported by KeyPairGenerator
for (Class priSpecType
: getCompatibleKeySpecs(kpgAlgo, KeyType.PRIVATE)) {
// Transform original PublicKey through KeySpec
KeySpec pubSpec = kf.getKeySpec(kp.getPublic(), pubSpecType);
PublicKey pubKey = kf.generatePublic(pubSpec);
// Transform original PrivateKey through KeySpec
KeySpec priSpec = kf.getKeySpec(kp.getPrivate(), priSpecType);
PrivateKey priKey = kf.generatePrivate(priSpec);
// Test the keys are equal after transformation through KeySpec.
testKeyEquals(kp, pubKey, priKey);
// Test the keys are serializable.
testSerialize(kp);
// Test Parameter name.
if (!kaAlgo.equals("DiffieHellman")) {
testParamName(priSpec, pubSpec);
}
// Compare KeyAgreement secret generated from original keys
// and by the keys after transformed through KeySpec.
if (!Arrays.equals(getKeyAgreementSecret(provider, kaAlgo,
kp.getPublic(), kp.getPrivate()),
getKeyAgreementSecret(provider, kaAlgo,
pubKey, priKey))) {
throw new RuntimeException("KeyAgreement secret mismatch.");
}
}
}
}
/**
* Standard Test with Keys and the one generated from encoded bytes.
*/
private static void testEncodedKeySpecs(String provider, String kaAlgo,
String kpgAlgo, KeyPair kp) throws Exception {
KeyFactory kf = KeyFactory.getInstance(kpgAlgo, provider);
PKCS8EncodedKeySpec priSpec
= new PKCS8EncodedKeySpec(kp.getPrivate().getEncoded());
PrivateKey priKey = kf.generatePrivate(priSpec);
X509EncodedKeySpec pubSpec
= new X509EncodedKeySpec(kp.getPublic().getEncoded());
PublicKey pubKey = kf.generatePublic(pubSpec);
// Test the keys are equal after transformation through KeySpec.
testKeyEquals(kp, pubKey, priKey);
// Test the keys are serializable.
testSerialize(kp);
// Test Parameter name.
if (!kaAlgo.equals("DiffieHellman")) {
testParamName(priSpec, pubSpec);
}
// Compare KeyAgreement secret generated from original keys
// and by the keys after transformed through KeySpec.
if (!Arrays.equals(getKeyAgreementSecret(provider, kaAlgo,
kp.getPublic(), kp.getPrivate()),
getKeyAgreementSecret(provider, kaAlgo, pubKey, priKey))) {
throw new RuntimeException("KeyAgreement secret mismatch.");
}
}
private enum KeyType {
PUBLIC, PRIVATE;
}
/**
* Provides Compatible KeySpec Type list for KeyPairGenerator algorithm.
*/
private static List<Class> getCompatibleKeySpecs(String kpgAlgo,
KeyType type) {
List<Class> specs = new ArrayList<>();
switch (kpgAlgo) {
case "DiffieHellman":
if (type == KeyType.PUBLIC) {
return Arrays.asList(X509EncodedKeySpec.class,
DHPublicKeySpec.class);
} else {
return Arrays.asList(PKCS8EncodedKeySpec.class,
DHPrivateKeySpec.class);
}
case "EC":
if (type == KeyType.PUBLIC) {
return Arrays.asList(X509EncodedKeySpec.class,
ECPublicKeySpec.class);
} else {
return Arrays.asList(PKCS8EncodedKeySpec.class,
ECPrivateKeySpec.class);
}
case "XDH":
if (type == KeyType.PUBLIC) {
return Arrays.asList(X509EncodedKeySpec.class,
XECPublicKeySpec.class);
} else {
return Arrays.asList(PKCS8EncodedKeySpec.class,
XECPrivateKeySpec.class);
}
}
return specs;
}
/**
* Generate KeyAgreement Secret.
*/
private static byte[] getKeyAgreementSecret(String provider, String kaAlgo,
PublicKey pubKey, PrivateKey priKey) throws Exception {
KeyAgreement ka = KeyAgreement.getInstance(kaAlgo, provider);
ka.init(priKey);
ka.doPhase(pubKey, true);
return ka.generateSecret();
}
/**
* Compare original KeyPair with transformed ones.
*/
private static void testKeyEquals(KeyPair kp, PublicKey pubKey,
PrivateKey priKey) {
if (!kp.getPrivate().equals(priKey)
&& kp.getPrivate().hashCode() != priKey.hashCode()) {
throw new RuntimeException("PrivateKey is not equal with PrivateKey"
+ " generated through KeySpec");
}
if (!kp.getPublic().equals(pubKey)
&& kp.getPublic().hashCode() != pubKey.hashCode()) {
throw new RuntimeException("PublicKey is not equal with PublicKey"
+ " generated through KeySpec");
}
}
/**
* Compare the parameter names of Public/Private KeySpec from a pair.
*/
private static void testParamName(KeySpec priSpec, KeySpec pubSpec) {
if (priSpec instanceof XECPrivateKeySpec
&& pubSpec instanceof XECPublicKeySpec) {
if (((NamedParameterSpec) ((XECPrivateKeySpec) priSpec)
.getParams()).getName()
!= ((NamedParameterSpec) ((XECPublicKeySpec) pubSpec)
.getParams()).getName()) {
throw new RuntimeException("Curve name mismatch found");
}
}
}
/**
* Test serialization of KeyPair and Keys it holds.
*/
private static void testSerialize(KeyPair keyPair) throws Exception {
// Verify Serialized PrivateKey instance.
if (!keyPair.getPrivate().equals(
deserializedCopy(keyPair.getPrivate(), PrivateKey.class))) {
throw new RuntimeException("PrivateKey is not equal with PrivateKey"
+ " generated through Serialization");
}
// Verify Serialized PublicKey instance.
if (!keyPair.getPublic().equals(
deserializedCopy(keyPair.getPublic(), PublicKey.class))) {
throw new RuntimeException("PublicKey is not equal with PublicKey"
+ " generated through Serialization");
}
// Verify Serialized KeyPair instance.
KeyPair copy = deserializedCopy(keyPair, KeyPair.class);
if (!keyPair.getPrivate().equals(copy.getPrivate())) {
throw new RuntimeException("PrivateKey is not equal with PrivateKey"
+ " generated through Serialized KeyPair");
}
if (!keyPair.getPublic().equals(copy.getPublic())) {
throw new RuntimeException("PublicKey is not equal with PublicKey"
+ " generated through Serialized KeyPair");
}
}
private static <T extends Object> T deserializedCopy(T orig, Class<T> type)
throws IOException, ClassNotFoundException {
return deserialize(serialize(orig), type);
}
/**
* Deserialize the Key object.
*/
private static <T extends Object> T deserialize(byte[] serialized,
Class<T> type) throws IOException, ClassNotFoundException {
T key = null;
try (ByteArrayInputStream bis = new ByteArrayInputStream(serialized);
ObjectInputStream ois = new ObjectInputStream(bis)) {
key = (T) ois.readObject();
}
return key;
}
/**
* Serialize the given Key object.
*/
private static <T extends Object> byte[] serialize(T key)
throws IOException {
try (ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(bos)) {
oos.writeObject(key);
return bos.toByteArray();
}
}
}

View file

@ -0,0 +1,152 @@
/*
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 8184359
* @library /test/lib
* @summary KeyPairGenerator Test with multiple threads.
* Arguments order <KeyExchangeAlgorithm> <Provider> <KeyGenAlgorithm> <Curve*>
* @run main MultiThreadTest DiffieHellman SunJCE DiffieHellman
* @run main MultiThreadTest ECDH SunEC EC
* @run main MultiThreadTest XDH SunEC XDH X25519
* @run main MultiThreadTest XDH SunEC XDH X448
*/
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.util.Arrays;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
import javax.crypto.KeyAgreement;
import jdk.test.lib.security.SecurityUtils;
/**
* This test targets KeyPairGenerator API related issue in a multi threaded
* context.
*/
public class MultiThreadTest {
// Tested a shared KeyPairGenerator with 100 number of threads.
private static final int THREAD_COUNT = 100;
public static void main(String[] args) throws Exception {
String kaAlgo = args[0];
String provider = System.getProperty("test.provider.name", args[1]);
String kpgAlgo = args[2];
KeyPairGenerator kpg = genKeyGenerator(provider, kpgAlgo,
(args.length > 3) ? args[3] : kpgAlgo);
new MultiThreadTest().runTest(provider, kaAlgo, kpg);
}
/**
* Initialize KeyPairGenerator based on different algorithm names.
*/
private static KeyPairGenerator genKeyGenerator(String provider,
String kpgAlgo, String kpgInit) throws Exception {
KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgo, provider);
switch (kpgInit) {
case "DiffieHellman":
kpg.initialize(SecurityUtils.getTestKeySize(kpgInit));
break;
case "EC":
kpg.initialize(256);
break;
case "X25519":
kpg.initialize(255);
break;
case "X448":
kpg.initialize(448);
break;
default:
throw new RuntimeException("Invalid Algo name " + kpgInit);
}
return kpg;
}
private void runTest(String provider, String kaAlgo, KeyPairGenerator kpg)
throws Exception {
ExecutorService executor = null;
try {
executor = Executors.newCachedThreadPool(new ThreadFactory() {
@Override
public Thread newThread(Runnable r) {
Thread t = Executors.defaultThreadFactory().newThread(r);
t.setDaemon(true);
return t;
}
});
CountDownLatch latch = new CountDownLatch(THREAD_COUNT);
for (int i = 0; i < THREAD_COUNT; i++) {
executor.execute(new Runnable() {
@Override
public void run() {
try {
testKeyAgreement(provider, kaAlgo, kpg);
} catch (Exception e) {
throw new RuntimeException(e);
} finally {
// Indicate a task completed.
latch.countDown();
}
}
});
}
// Wait till all tasks get complete.
latch.await();
} finally {
if (executor != null) {
executor.shutdown();
}
}
}
/**
* Perform KeyAgreement operation with a shared KeyPairGenerator instance.
*/
private static void testKeyAgreement(String provider, String kaAlgo,
KeyPairGenerator kpg) throws Exception {
KeyPair kp1 = kpg.generateKeyPair();
KeyPair kp2 = kpg.generateKeyPair();
KeyAgreement ka1 = KeyAgreement.getInstance(kaAlgo, provider);
ka1.init(kp1.getPrivate());
ka1.doPhase(kp2.getPublic(), true);
byte[] secret1 = ka1.generateSecret();
KeyAgreement ka2 = KeyAgreement.getInstance(kaAlgo, provider);
ka2.init(kp2.getPrivate());
ka2.doPhase(kp1.getPublic(), true);
byte[] secret2 = ka2.generateSecret();
// With related keypairs, generated KeyAgreement secret should be same.
if (!Arrays.equals(secret1, secret2)) {
throw new Exception("KeyAgreement secret mismatch.");
}
}
}

View file

@ -0,0 +1,408 @@
/*
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 8200219
* @summary Negative tests for Key related Test with DiffieHellman, ECDH, XDH.
* It Tests,
* Use modified encoding while generating Public/Private Keys
* Short, long, unsupported keysize
* Invalid Algo names including Null
* Invalid provider names including Null
* Invalid curve names
* Invalid spec usage
* Arguments order <KeyExchangeAlgorithm> <Provider> <KeyGenAlgorithm>
* <keySize> <Curve*>
* @library /test/lib
* @run main NegativeTest DiffieHellman SunJCE DiffieHellman 2048
* @run main NegativeTest ECDH SunEC EC 256
* @run main NegativeTest XDH SunEC XDH 255 X25519
* @run main NegativeTest XDH SunEC XDH 448 X448
*/
import java.math.BigInteger;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidParameterException;
import java.security.KeyFactory;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.security.Security;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.NamedParameterSpec;
import java.security.spec.KeySpec;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
import java.security.spec.XECPrivateKeySpec;
import java.security.spec.XECPublicKeySpec;
import java.util.Arrays;
import java.util.HexFormat;
import javax.crypto.KeyAgreement;
import jdk.test.lib.security.SecurityUtils;
public class NegativeTest {
public static void main(String[] args) throws Exception {
String kaAlgo = args[0];
String provider = System.getProperty("test.provider.name", args[1]);
String kpgAlgo = args[2];
int keySize = Integer.parseInt(args[3]);
String kpgInit = (args.length > 4) ? args[4] : args[2];
testModifiedKeyEncodingTest(provider, kpgAlgo, kpgInit);
testInvalidKeyLen(provider, kaAlgo, kpgAlgo, kpgInit);
testInvalidKpgAlgo(provider, kaAlgo, keySize);
testInvalidKaAlgo(provider, kpgAlgo, keySize);
testInvalidProvider(kaAlgo, kpgAlgo, keySize);
if (!kaAlgo.equals("DiffieHellman")) {
testNamedParameter(provider, kpgAlgo);
}
if (kaAlgo.equals("XDH")) {
testInvalidSpec(provider, kpgAlgo, kpgInit);
testInCompatibleSpec(provider, kpgAlgo, kpgInit);
}
}
/**
* Generate keyPair based on KeyPairGenerator algorithm.
*/
private static KeyPair genKeyPair(String provider, String kpgAlgo,
String kpgInit) throws Exception {
KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgo,
Security.getProvider(provider));
switch (kpgInit) {
case "DiffieHellman":
kpg.initialize(SecurityUtils.getTestKeySize(kpgInit));
break;
case "EC":
kpg.initialize(256);
break;
case "X25519":
kpg.initialize(255);
break;
case "X448":
kpg.initialize(448);
break;
default:
throw new RuntimeException("Invalid Algo name " + kpgInit);
}
return kpg.generateKeyPair();
}
private static void testModifiedKeyEncodingTest(String provider,
String kpgAlgo, String kpgInit) throws Exception {
KeyFactory kf = KeyFactory.getInstance(kpgAlgo, provider);
KeyPair kp = genKeyPair(provider, kpgAlgo, kpgInit);
// Test modified PrivateKey encoding
byte[] encoded = kp.getPrivate().getEncoded();
byte[] modified = modifyEncoded(encoded);
PKCS8EncodedKeySpec priSpec = new PKCS8EncodedKeySpec(modified);
try {
// Generate PrivateKey with modified encoding
kf.generatePrivate(priSpec);
throw new RuntimeException(
"testModifiedKeyTest should fail but passed.");
} catch (InvalidKeySpecException e) {
System.out.printf("Expected InvalidKeySpecException for invalid "
+ "PrivateKey %s%n and modified encoding: %s, %s%n",
HexFormat.of().withUpperCase().formatHex(encoded),
HexFormat.of().withUpperCase().formatHex(modified), e.getMessage());
}
// Test modified PublicKey encoding
encoded = kp.getPublic().getEncoded();
modified = modifyEncoded(encoded);
X509EncodedKeySpec pubSpec = new X509EncodedKeySpec(modified);
try {
// Generate PublicKey with modified encoding
kf.generatePublic(pubSpec);
throw new RuntimeException(
"testModifiedKeyTest should fail but passed.");
} catch (InvalidKeySpecException e) {
System.out.printf("Expected InvalidKeySpecException for invalid "
+ "PublicKey %s%n and modified encoding: %s, %s%n",
HexFormat.of().withUpperCase().formatHex(encoded),
HexFormat.of().withUpperCase().formatHex(modified), e.getMessage());
}
}
/**
* Test with all Invalid key length.
*/
private static void testInvalidKeyLen(String provider, String kaAlgo,
String kpgAlgo, String kpgInit) throws Exception {
for (int keySize : selectInvalidKeylength(kpgInit)) {
try {
startKeyAgreement(provider, kaAlgo, kpgAlgo, keySize);
throw new RuntimeException(
"testInvalidKeyLen should fail but passed.");
} catch (InvalidParameterException e) {
System.out.printf("Expected InvalidParameterException for "
+ "keyLength: %s, %s%n", keySize, e.getMessage());
}
}
}
/**
* Test with all Invalid KeyPairGenerator algorithms.
*/
private static void testInvalidKpgAlgo(String provider, String algo,
int keySize) throws Exception {
for (String kpgAlgo : new String[]{null, " ", "", "NoSuchAlgorithm"}) {
try {
startKeyAgreement(provider, algo, kpgAlgo, keySize);
throw new RuntimeException(
"testInvalidKpgAlgo should fail but passed.");
} catch (NoSuchAlgorithmException e) {
System.out.printf("Expected NoSuchAlgorithmException for "
+ "KeyAgreement algo: %s, %s%n",
kpgAlgo, e.getMessage());
} catch (NullPointerException e) {
if (kpgAlgo == null) {
System.out.printf("Expected NullPointerException for "
+ "KeyPairGenerator algo: %s, %s%n",
kpgAlgo, e.getMessage());
continue;
}
throw new RuntimeException(
"Unknown failure in testInvalidKpgAlgo.");
}
}
}
/**
* Test with all Invalid KeyAgreement algorithms.
*/
private static void testInvalidKaAlgo(String provider, String kpgAlgo,
int keySize) throws Exception {
for (String algo : new String[]{null, " ", "", "NoSuchAlgorithm"}) {
try {
startKeyAgreement(provider, algo, kpgAlgo, keySize);
throw new RuntimeException(
"testInvalidKaAlgo should fail but passed.");
} catch (NoSuchAlgorithmException e) {
System.out.printf("Expected NoSuchAlgorithmException for "
+ "KeyAgreement algo: %s, %s%n", algo, e.getMessage());
} catch (NullPointerException e) {
if (algo == null) {
System.out.printf("Expected NullPointerException for "
+ "KeyAgreement algo: %s, %s%n",
algo, e.getMessage());
continue;
}
throw new RuntimeException(
"Unknown failure in testInvalidKaAlgo.");
}
}
}
/**
* Test with all Invalid Provider names.
*/
private static void testInvalidProvider(String kaAlgo, String kpgAlgo,
int keySize) throws Exception {
for (String provider : new String[]{null, " ", "", "NoSuchProvider"}) {
try {
startKeyAgreement(provider, kaAlgo, kpgAlgo, keySize);
throw new RuntimeException(
"testInvalidProvider should fail but passed.");
} catch (NoSuchProviderException e) {
System.out.printf("Expected NoSuchProviderException for "
+ "Provider: %s, %s%n", provider, e.getMessage());
} catch (IllegalArgumentException e) {
System.out.printf("Expected IllegalArgumentException for "
+ "Provider: %s, %s%n", provider, e.getMessage());
}
}
}
/**
* Test for (in)valid curve names as argument to NamedParameterSpec
*/
private static void testNamedParameter(String provider, String kpgAlgo)
throws Exception {
for (String name : new String[]{null, " ", "", "NoSuchCurve"}) {
try {
NamedParameterSpec spec = new NamedParameterSpec(name);
KeyPairGenerator kpg
= KeyPairGenerator.getInstance(kpgAlgo, provider);
kpg.initialize(spec);
kpg.generateKeyPair();
throw new RuntimeException(
"testNamedParameter should fail but passed.");
} catch (NullPointerException e) {
if (name == null) {
System.out.printf("Expected NullPointerException for "
+ "NamedParameterSpec name: %s, %s%n",
name, e.getMessage());
continue;
}
throw new RuntimeException(
"Unknown failure in testNamedParameter.");
} catch (InvalidAlgorithmParameterException e) {
System.out.printf("Expected InvalidAlgorithmParameterException"
+ " for NamedParameterSpec name: %s, %s%n",
name, e.getMessage());
}
}
}
/**
* Test to generate Public/Private keys using (in)valid coordinate/scalar.
*/
private static void testInvalidSpec(String provider,
String kpgAlgo, String curve) throws Exception {
NamedParameterSpec spec = new NamedParameterSpec(curve);
KeyFactory kf = KeyFactory.getInstance(kpgAlgo, provider);
int validLen = curve.equalsIgnoreCase("X448") ? 56 : 32;
for (byte[] scalarBytes : new byte[][]{null, new byte[]{},
new byte[32], new byte[56], new byte[65535]}) {
try {
KeySpec privateSpec = new XECPrivateKeySpec(spec, scalarBytes);
kf.generatePrivate(privateSpec);
if (scalarBytes.length != validLen) {
throw new RuntimeException(String.format("testInvalidSpec "
+ "should fail but passed when Scalar bytes length "
+ "!= %s for curve %s", validLen, curve));
}
} catch (NullPointerException e) {
if (scalarBytes == null) {
System.out.printf("Expected NullPointerException for "
+ "scalar: %s, %s%n", scalarBytes, e.getMessage());
continue;
}
throw new RuntimeException(e);
} catch (InvalidKeySpecException e) {
if (scalarBytes.length != validLen) {
System.out.printf("Expected InvalidKeySpecException for "
+ "scalar length %s and curve %s: %s%n",
scalarBytes.length, curve, e.getMessage());
continue;
}
throw new RuntimeException(e);
}
}
for (BigInteger coordinate : new BigInteger[]{null, BigInteger.ZERO,
BigInteger.ONE, new BigInteger("2").pow(255),
new BigInteger("2").pow(448)}) {
try {
KeySpec publicSpec = new XECPublicKeySpec(spec, coordinate);
kf.generatePublic(publicSpec);
} catch (NullPointerException e) {
if (coordinate == null) {
System.out.printf("Expected NullPointerException for "
+ "coordinate : %s, %s%n", coordinate,
e.getMessage());
continue;
}
throw new RuntimeException(e);
}
}
}
private static void testInCompatibleSpec(String provider,
String kpgAlgo, String curve) throws Exception {
int validLen = curve.equalsIgnoreCase("X448") ? 56 : 32;
NamedParameterSpec spec = new NamedParameterSpec(curve);
KeyFactory kf = KeyFactory.getInstance(kpgAlgo, provider);
KeySpec privateSpec = new XECPrivateKeySpec(spec, new byte[validLen]);
KeySpec publicSpec = new XECPublicKeySpec(spec, BigInteger.ONE);
try {
kf.generatePrivate(publicSpec);
throw new RuntimeException(
"testInCompatibleSpec should fail but passed.");
} catch (InvalidKeySpecException e) {
System.out.printf("Expected XECPublicKeySpec to XECPrivateKeySpec :"
+ " %s%n", e.getMessage());
}
try {
kf.generatePublic(privateSpec);
throw new RuntimeException(
"testInCompatibleSpec should fail but passed.");
} catch (InvalidKeySpecException e) {
System.out.printf("Expected XECPrivateKeySpec to XECPublicKeySpec :"
+ " %s%n", e.getMessage());
}
}
/**
* Perform KeyAgreement operation.
*/
private static void startKeyAgreement(String provider, String kaAlgo,
String kpgAlgo, int keySize) throws Exception {
KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgo, provider);
kpg.initialize(keySize);
KeyPair kp = kpg.generateKeyPair();
KeyAgreement ka = KeyAgreement.getInstance(kaAlgo, provider);
ka.init(kp.getPrivate());
ka.doPhase(kp.getPublic(), true);
ka.generateSecret();
}
/**
* Return manipulated encoded bytes.
*/
private static byte[] modifyEncoded(byte[] encoded) {
byte[] copy = Arrays.copyOf(encoded, encoded.length);
for (int i = 0; i < copy.length; i++) {
copy[i] = (byte) ~copy[i];
}
return copy;
}
/**
* Select invalid key sizes for different Key generation algorithms.
*/
private static int[] selectInvalidKeylength(String kpgInit) {
int[] keySize = new int[]{};
switch (kpgInit) {
case "DiffieHellman":
keySize = new int[]{256, 513, 1023, 2176, 4032, 6400, 8200};
break;
case "EC":
keySize = new int[]{100, 300};
break;
case "X25519":
keySize = new int[]{100, 300};
break;
case "X448":
keySize = new int[]{100, 500};
break;
default:
throw new RuntimeException("Invalid Algo name " + kpgInit);
}
return keySize;
}
}

View file

@ -0,0 +1,164 @@
/*
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* @test
* @bug 4894125 7054918 8130181
* @library /test/lib
* @summary test that failover for KeyFactory works
* @author Andreas Sterbenz
*/
import java.util.*;
import java.security.*;
import java.security.spec.*;
import jdk.test.lib.security.ProvidersSnapshot;
import jdk.test.lib.security.SecurityUtils;
public class Failover {
public static void main(String[] args) throws Exception {
ProvidersSnapshot snapshot = ProvidersSnapshot.create();
try {
main0(args);
} finally {
snapshot.restore();
}
}
public static void main0(String[] args) throws Exception {
Security.insertProviderAt(new ProviderFail(), 1);
Security.addProvider(new ProviderPass());
System.out.println(Arrays.asList(Security.getProviders()));
KeyFactory kf;
kf = KeyFactory.getInstance("FOO");
kf.generatePublic(null);
kf.generatePublic(null);
kf.generatePrivate(null);
kf = KeyFactory.getInstance("FOO");
kf.generatePrivate(null);
kf.getKeySpec(null, null);
kf.translateKey(null);
kf = KeyFactory.getInstance("FOO");
kf.getKeySpec(null, null);
kf.translateKey(null);
kf = KeyFactory.getInstance("FOO");
kf.translateKey(null);
// somewhat more real tests using DSA
System.out.println("DSA tests...");
String kpgAlgorithm = "DSA";
KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgorithm);
kpg.initialize(SecurityUtils.getTestKeySize(kpgAlgorithm));
KeyPair kp = kpg.generateKeyPair();
kf = KeyFactory.getInstance("DSA");
System.out.println(kf.translateKey(kp.getPrivate()));
kf = KeyFactory.getInstance("DSA");
KeySpec spec = kf.getKeySpec(kp.getPublic(), DSAPublicKeySpec.class);
kf = KeyFactory.getInstance("DSA");
System.out.println(kf.generatePublic(spec));
kf = KeyFactory.getInstance("DSA");
try {
kf.generatePrivate(spec);
throw new Exception("no exception");
} catch (InvalidKeySpecException e) {
System.out.println(e);
}
}
private static class ProviderPass extends Provider {
ProviderPass() {
super("Pass", "1.0", "Pass");
put("KeyFactory.FOO" , "Failover$KeyFactoryPass");
}
}
private static class ProviderFail extends Provider {
ProviderFail() {
super("Fail", "1.0", "Fail");
put("KeyFactory.FOO" , "Failover$KeyFactoryFail");
put("KeyFactory.DSA" , "Failover$KeyFactoryFail");
}
}
public static class KeyFactoryPass extends KeyFactorySpi {
protected PublicKey engineGeneratePublic(KeySpec keySpec) throws InvalidKeySpecException {
System.out.println("MyKeyFactoryPass.engineGeneratePublic()");
return null;
}
protected PrivateKey engineGeneratePrivate(KeySpec keySpec) throws InvalidKeySpecException {
System.out.println("MyKeyFactoryPass.engineGeneratePrivate()");
return null;
}
protected <T extends KeySpec> T
engineGetKeySpec(Key key, Class<T> keySpec) throws InvalidKeySpecException
{
System.out.println("MyKeyFactoryPass.engineGetKeySpec()");
return null;
}
protected Key engineTranslateKey(Key key) throws InvalidKeyException {
System.out.println("MyKeyFactoryPass.engineTranslateKey()");
return null;
}
}
public static class KeyFactoryFail extends KeyFactorySpi {
protected PublicKey engineGeneratePublic(KeySpec keySpec) throws InvalidKeySpecException {
System.out.println("MyKeyFactoryFail.engineGeneratePublic()");
throw new InvalidKeySpecException();
}
protected PrivateKey engineGeneratePrivate(KeySpec keySpec) throws InvalidKeySpecException {
System.out.println("MyKeyFactoryFail.engineGeneratePrivate()");
throw new InvalidKeySpecException();
}
protected <T extends KeySpec> T engineGetKeySpec(Key key, Class<T> keySpec) throws InvalidKeySpecException {
System.out.println("MyKeyFactoryFail.engineGetKeySpec()");
throw new InvalidKeySpecException();
}
protected Key engineTranslateKey(Key key) throws InvalidKeyException {
System.out.println("MyKeyFactoryFail.engineTranslateKey()");
throw new InvalidKeyException();
}
}
}

View file

@ -0,0 +1,189 @@
/*
* Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4413634
* @summary Make sure that RSA Private CRT Key factory generation using
* java.security.spec.RSAPrivateCrtKeySpec passes
*/
import java.math.BigInteger;
import java.security.KeyFactory;
import java.security.interfaces.RSAPrivateCrtKey;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.RSAPrivateCrtKeySpec;
import java.util.Arrays;
public class GenerateRSAPrivateCrtKey {
public static void main(String[] args) throws Exception {
// Create an RSA Private Key from the CRT information
RSAPrivateCrtKeySpec rsaCrtSpec =
new RSAPrivateCrtKeySpec(new BigInteger(1, modulus),
new BigInteger(1, pubExpo),
new BigInteger(1, priExpo),
new BigInteger(1, primeP),
new BigInteger(1, primeQ),
new BigInteger(1, expoP),
new BigInteger(1, expoQ),
new BigInteger(1, coeff));
// Create an RSA private key from the CRT specification
KeyFactory kf = KeyFactory.getInstance("RSA",
System.getProperty("test.provider.name", "SunRsaSign"));
RSAPrivateCrtKey rsaPriKey =
(RSAPrivateCrtKey) kf.generatePrivate(rsaCrtSpec);
// test resulting key against original specification
if (!rsaPriKey.getCrtCoefficient().equals(rsaCrtSpec.getCrtCoefficient()))
throw new Exception("coefficients not equal");
if (!rsaPriKey.getPrimeExponentP().equals(rsaCrtSpec.getPrimeExponentP()))
throw new Exception("primeExponentPs not equal");
if (!rsaPriKey.getPrimeExponentQ().equals(rsaCrtSpec.getPrimeExponentQ()))
throw new Exception("primeExponentQs not equal");
if (!rsaPriKey.getPrimeP().equals(rsaCrtSpec.getPrimeP()))
throw new Exception("primePs not equal");
if (!rsaPriKey.getPrimeQ().equals(rsaCrtSpec.getPrimeQ()))
throw new Exception("primeQs not equal");
if (!rsaPriKey.getPublicExponent().equals(rsaCrtSpec.getPublicExponent()))
throw new Exception("public exponents not equal");
if (!rsaPriKey.getPrivateExponent().equals(rsaCrtSpec.getPrivateExponent()))
throw new Exception("private exponents not equal");
if (!rsaPriKey.getModulus().equals(rsaCrtSpec.getModulus()))
throw new Exception("modulus not equal");
if (!rsaPriKey.getFormat().equals("PKCS#8") &&
!rsaPriKey.getFormat().equals("PKCS8"))
throw new Exception("format not PKCS#8");
if (!rsaPriKey.getAlgorithm().equals("RSA"))
throw new Exception("algorithm not RSA");
if (rsaPriKey.getEncoded() == null)
throw new Exception("encoded key is null");
PKCS8EncodedKeySpec pkcs8Key =
new PKCS8EncodedKeySpec(rsaPriKey.getEncoded());
RSAPrivateCrtKey rsaPriKey2
= (RSAPrivateCrtKey) kf.generatePrivate(pkcs8Key);
if (!Arrays.equals(rsaPriKey.getEncoded(), rsaPriKey2.getEncoded()))
throw new Exception("encoded keys not equal");
}
static byte[] modulus = {
(byte)0xab, (byte)0x38, (byte)0x39, (byte)0x40,
(byte)0x54, (byte)0x2c, (byte)0xac, (byte)0x9a,
(byte)0xc0, (byte)0x37, (byte)0x40, (byte)0xd0,
(byte)0x49, (byte)0x04, (byte)0xed, (byte)0x51,
(byte)0x0e, (byte)0x95, (byte)0x72, (byte)0x02,
(byte)0x51, (byte)0xc2, (byte)0xad, (byte)0x9d,
(byte)0xa7, (byte)0xeb, (byte)0xba, (byte)0x29,
(byte)0xae, (byte)0xd4, (byte)0x49, (byte)0x79,
(byte)0x53, (byte)0xfa, (byte)0xdf, (byte)0x01,
(byte)0x6c, (byte)0xbc, (byte)0x69, (byte)0x46,
(byte)0x4c, (byte)0x83, (byte)0x1b, (byte)0xd9,
(byte)0x3b, (byte)0x59, (byte)0x42, (byte)0x04,
(byte)0x99, (byte)0x0f, (byte)0x63, (byte)0x24,
(byte)0x75, (byte)0xa0, (byte)0xbe, (byte)0x6f,
(byte)0x92, (byte)0x4d, (byte)0x9d, (byte)0xa2,
(byte)0x40, (byte)0xda, (byte)0xf8, (byte)0x49
};
static byte[] pubExpo = {
(byte)0x01, (byte)0x00, (byte)0x01
};
static byte[] priExpo = {
(byte)0x4a, (byte)0xd2, (byte)0xe7, (byte)0x32,
(byte)0x15, (byte)0x96, (byte)0xf0, (byte)0x57,
(byte)0x30, (byte)0x68, (byte)0xf5, (byte)0x0a,
(byte)0x10, (byte)0xde, (byte)0xf6, (byte)0x56,
(byte)0xd5, (byte)0xe8, (byte)0xb9, (byte)0x4a,
(byte)0x0a, (byte)0x30, (byte)0xe9, (byte)0x6e,
(byte)0x5c, (byte)0x53, (byte)0xc7, (byte)0xa7,
(byte)0x2f, (byte)0x9f, (byte)0xd5, (byte)0xfb,
(byte)0x58, (byte)0x9b, (byte)0x1e, (byte)0x5b,
(byte)0xe8, (byte)0x6e, (byte)0xae, (byte)0x02,
(byte)0xaa, (byte)0x15, (byte)0x23, (byte)0x67,
(byte)0xaa, (byte)0x20, (byte)0x9e, (byte)0x82,
(byte)0x76, (byte)0x4c, (byte)0xad, (byte)0xe1,
(byte)0x95, (byte)0xde, (byte)0xe3, (byte)0x25,
(byte)0x66, (byte)0x2f, (byte)0xb0, (byte)0xab,
(byte)0x1c, (byte)0xe5, (byte)0xa0, (byte)0x01
};
static byte[] primeP = {
(byte)0xd1, (byte)0xeb, (byte)0x51, (byte)0xbd,
(byte)0x09, (byte)0x26, (byte)0x7e, (byte)0xe7,
(byte)0x12, (byte)0x8c, (byte)0xeb, (byte)0x5c,
(byte)0x32, (byte)0x18, (byte)0xd1, (byte)0x60,
(byte)0x0b, (byte)0x49, (byte)0x67, (byte)0x8f,
(byte)0x78, (byte)0x3c, (byte)0x58, (byte)0xc5,
(byte)0xb0, (byte)0x01, (byte)0x70, (byte)0xee,
(byte)0x1a, (byte)0xcf, (byte)0x6e, (byte)0xe1
};
static byte[] primeQ = {
(byte)0xd0, (byte)0xce, (byte)0x21, (byte)0x83,
(byte)0x41, (byte)0x73, (byte)0xf6, (byte)0x84,
(byte)0x32, (byte)0x06, (byte)0xa8, (byte)0xa6,
(byte)0xad, (byte)0x13, (byte)0x2b, (byte)0x65,
(byte)0x27, (byte)0x86, (byte)0x28, (byte)0xef,
(byte)0x0e, (byte)0x8c, (byte)0xca, (byte)0x4f,
(byte)0x20, (byte)0xc0, (byte)0x19, (byte)0x95,
(byte)0xfe, (byte)0x6c, (byte)0x3e, (byte)0x69
};
static byte[] expoP = {
(byte)0x1a, (byte)0x49, (byte)0x9c, (byte)0xb7,
(byte)0xce, (byte)0x80, (byte)0x8a, (byte)0x9d,
(byte)0xc7, (byte)0x3d, (byte)0xec, (byte)0x6f,
(byte)0x64, (byte)0x3a, (byte)0xa5, (byte)0x65,
(byte)0xa0, (byte)0xa4, (byte)0x35, (byte)0x9a,
(byte)0xca, (byte)0xd4, (byte)0xcb, (byte)0xcd,
(byte)0x1d, (byte)0xc8, (byte)0x60, (byte)0x6b,
(byte)0x00, (byte)0xe2, (byte)0x7f, (byte)0x21
};
static byte[] expoQ = {
(byte)0xa7, (byte)0x93, (byte)0xd7, (byte)0x77,
(byte)0x94, (byte)0xef, (byte)0x31, (byte)0x78,
(byte)0x55, (byte)0x01, (byte)0xdd, (byte)0x16,
(byte)0xaf, (byte)0xae, (byte)0xc3, (byte)0xd4,
(byte)0x12, (byte)0x0d, (byte)0x6d, (byte)0x0a,
(byte)0xb6, (byte)0xdd, (byte)0xad, (byte)0x7c,
(byte)0x25, (byte)0xe7, (byte)0xa6, (byte)0x61,
(byte)0x27, (byte)0xe8, (byte)0xcd, (byte)0x89
};
static byte[] coeff = {
(byte)0x0b, (byte)0xdb, (byte)0x90, (byte)0x7f,
(byte)0x33, (byte)0xc5, (byte)0x1f, (byte)0x5b,
(byte)0x4d, (byte)0xa4, (byte)0x86, (byte)0xda,
(byte)0x77, (byte)0xd4, (byte)0xb3, (byte)0x1d,
(byte)0xbc, (byte)0xc3, (byte)0xae, (byte)0x0b,
(byte)0xac, (byte)0x91, (byte)0xf3, (byte)0x38,
(byte)0x4a, (byte)0xcf, (byte)0x10, (byte)0xb1,
(byte)0x5e, (byte)0x5a, (byte)0xd1, (byte)0x86
};
}

View file

@ -0,0 +1,137 @@
/*
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
* Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* @test
* @bug 8254717 8263404
* @summary isAssignableFrom checks in KeyFactorySpi.engineGetKeySpec appear to be backwards.
* @author Greg Rubin, Ziyi Luo
*/
import java.math.BigInteger;
import java.security.KeyFactory;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.interfaces.RSAPrivateCrtKey;
import java.security.interfaces.RSAPrivateKey;
import java.security.spec.*;
public class KeyFactoryGetKeySpecForInvalidSpec {
// Test for 8263404: This method generates RSAPrivateKey (without Crt info) from a RSAPrivateCrtKey
public static RSAPrivateKey privateCrtToPrivate(RSAPrivateCrtKey crtKey) {
return new RSAPrivateKey() {
@Override
public BigInteger getPrivateExponent() {
return crtKey.getPrivateExponent();
}
@Override
public String getAlgorithm() {
return crtKey.getAlgorithm();
}
@Override
public String getFormat() {
return crtKey.getFormat();
}
@Override
public byte[] getEncoded() {
return crtKey.getEncoded();
}
@Override
public BigInteger getModulus() {
return crtKey.getModulus();
}
};
}
public static void main(String[] args) throws Exception {
KeyPairGenerator kg = KeyPairGenerator.getInstance("RSA",
System.getProperty("test.provider.name", "SunRsaSign"));
kg.initialize(2048);
KeyPair pair = kg.generateKeyPair();
KeyFactory factory = KeyFactory.getInstance("RSA");
// === Case 1: private key is RSAPrivateCrtKey, keySpec is RSAPrivateKeySpec
// === Expected: return RSAPrivateCrtKeySpec
// Since RSAPrivateCrtKeySpec inherits from RSAPrivateKeySpec, we'd expect this next line to return an instance of RSAPrivateKeySpec
// (because the private key has CRT parts).
KeySpec spec = factory.getKeySpec(pair.getPrivate(), RSAPrivateKeySpec.class);
if (!(spec instanceof RSAPrivateCrtKeySpec)) {
throw new Exception("Spec should be an instance of RSAPrivateCrtKeySpec");
}
// === Case 2: private key is RSAPrivateCrtKey, keySpec is RSAPrivateCrtKeySpec
// === Expected: return RSAPrivateCrtKeySpec
spec = factory.getKeySpec(pair.getPrivate(), RSAPrivateCrtKeySpec.class);
if (!(spec instanceof RSAPrivateCrtKeySpec)) {
throw new Exception("Spec should be an instance of RSAPrivateCrtKeySpec");
}
// === Case 3: private key is RSAPrivateKey, keySpec is RSAPrivateKeySpec
// === Expected: return RSAPrivateKeySpec not RSAPrivateCrtKeySpec
RSAPrivateKey notCrtKey = privateCrtToPrivate((RSAPrivateCrtKey)pair.getPrivate());
// InvalidKeySpecException should not be thrown
KeySpec notCrtSpec = factory.getKeySpec(notCrtKey, RSAPrivateKeySpec.class);
if (notCrtSpec instanceof RSAPrivateCrtKeySpec) {
throw new Exception("Spec should be an instance of RSAPrivateKeySpec not RSAPrivateCrtKeySpec");
}
if (!(notCrtSpec instanceof RSAPrivateKeySpec)) {
throw new Exception("Spec should be an instance of RSAPrivateKeySpec");
}
// === Case 4: private key is RSAPrivateKey, keySpec is RSAPrivateCrtKeySpec
// === Expected: throw InvalidKeySpecException
try {
factory.getKeySpec(notCrtKey, RSAPrivateCrtKeySpec.class);
throw new Exception("InvalidKeySpecException is expected but not thrown");
} catch (InvalidKeySpecException e) {
// continue;
}
// This next line should give an InvalidKeySpec exception
try {
spec = factory.getKeySpec(pair.getPublic(), FakeX509Spec.class);
throw new Exception("InvalidKeySpecException is expected but not thrown");
} catch (final ClassCastException ex) {
throw new Exception("InvalidKeySpecException is expected ClassCastException is thrown", ex);
} catch (final InvalidKeySpecException ex) {
// Pass
}
}
public static class FakeX509Spec extends X509EncodedKeySpec {
public FakeX509Spec(byte[] encodedKey) {
super(encodedKey);
}
public FakeX509Spec(byte[] encodedKey, String algorithm) {
super(encodedKey, algorithm);
}
}
}

View file

@ -0,0 +1,168 @@
/*
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* @test
* @bug 4894125 7054918 8130181
* @library /test/lib
* @summary test that failover for KeyPairGenerator works
* @author Andreas Sterbenz
*/
import java.util.*;
import java.security.*;
import java.security.spec.*;
import jdk.test.lib.security.ProvidersSnapshot;
public class Failover {
public static void main(String[] args) throws Exception {
ProvidersSnapshot snapshot = ProvidersSnapshot.create();
try {
main0(args);
} finally {
snapshot.restore();
}
}
public static void main0(String[] args) throws Exception {
Security.insertProviderAt(new ProviderFail(), 1);
Security.addProvider(new ProviderPass());
System.out.println(Arrays.asList(Security.getProviders()));
KeyPairGenerator kpg;
kpg = KeyPairGenerator.getInstance("FOO");
kpg.generateKeyPair();
kpg.generateKeyPair();
kpg = KeyPairGenerator.getInstance("FOO");
kpg.initialize(1024);
kpg.initialize(1024);
kpg.initialize(null, null);
kpg.generateKeyPair();
kpg = KeyPairGenerator.getInstance("FOO");
kpg.initialize(null, null);
kpg.generateKeyPair();
kpg = KeyPairGenerator.getInstance("FOO");
kpg.initialize(512);
kpg.generateKeyPair();
kpg.generateKeyPair();
// the SUN DSA KeyPairGenerator implementation extends
// KeyPairGenerator (in order to implement
// java.security.interfaces.DSAKeyPairGenerator)
// failover cannot work
kpg = KeyPairGenerator.getInstance("DSA");
try {
kpg.initialize(1024);
throw new Exception("no exception");
} catch (InvalidParameterException e) {
System.out.println(e);
}
KeyPair kp;
kpg = KeyPairGenerator.getInstance("RSA");
kpg.initialize(512);
kp = kpg.generateKeyPair();
System.out.println(kp.getPublic());
kpg = KeyPairGenerator.getInstance("RSA");
kpg.initialize(768);
kp = kpg.generateKeyPair();
System.out.println(kp.getPublic());
kpg = KeyPairGenerator.getInstance("RSA");
kp = kpg.generateKeyPair();
System.out.println(kp.getPublic());
kpg = KeyPairGenerator.getInstance("RSA");
try {
kpg.initialize(128);
throw new Exception("no exception");
} catch (InvalidParameterException e) {
System.out.println(e);
}
}
private static class ProviderPass extends Provider {
ProviderPass() {
super("Pass", "1.0", "Pass");
put("KeyPairGenerator.FOO" , "Failover$KeyPairGeneratorPass");
}
}
private static class ProviderFail extends Provider {
ProviderFail() {
super("Fail", "1.0", "Fail");
put("KeyPairGenerator.FOO" , "Failover$KeyPairGeneratorFail");
put("KeyPairGenerator.DSA" , "Failover$KeyPairGeneratorFail");
put("KeyPairGenerator.RSA" , "Failover$KeyPairGeneratorFail");
}
}
public static class KeyPairGeneratorPass extends KeyPairGeneratorSpi {
public void initialize(int keysize, SecureRandom random) {
System.out.println("KeyPairGeneratorPass.initialize(" + keysize + ", " + random + ")");
}
public void initialize(AlgorithmParameterSpec params,
SecureRandom random) throws InvalidAlgorithmParameterException {
System.out.println("KeyPairGeneratorPass.initialize()");
}
public KeyPair generateKeyPair() {
System.out.println("KeyPairGeneratorPass.generateKeyPair()");
return null;
}
}
public static class KeyPairGeneratorFail extends KeyPairGeneratorSpi {
public void initialize(int keysize, SecureRandom random) {
if (keysize != 512) {
System.out.println("KeyPairGeneratorFail.initialize()");
throw new InvalidParameterException();
}
System.out.println("KeyPairGeneratorFail.initialize() PASS");
}
public void initialize(AlgorithmParameterSpec params,
SecureRandom random) throws InvalidAlgorithmParameterException {
System.out.println("KeyPairGeneratorFail.initialize()");
throw new InvalidParameterException();
}
public KeyPair generateKeyPair() {
System.out.println("KeyPairGeneratorFail.generateKeyPair()");
throw new InvalidParameterException();
}
}
}

View file

@ -0,0 +1,90 @@
/*
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* @test
* @bug 8163896 8223003
* @summary Finalizing one key of a KeyPair invalidates the other key
*/
import java.security.Key;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.NoSuchAlgorithmException;
import java.security.Provider;
import java.security.ProviderException;
import java.security.Security;
import java.util.function.Consumer;
import java.util.ArrayList;
import java.util.List;
public class FinalizeHalf {
static int failures = 0;
public static void main(String[] args) throws Throwable {
List<Consumer<Key>> methods = new ArrayList<>();
methods.add((Key k) -> k.getEncoded());
methods.add((Key k) -> k.toString());
for (String algo : new String[] {"DiffieHellman", "DSA", "RSA"}) {
for (Provider provider : Security.getProviders()) {
for (boolean priv : new boolean[] {true, false}) {
for (Consumer<Key> method : methods) {
test(algo, provider, priv, method);
}
}
}
}
if (failures > 0) {
throw new RuntimeException(failures + " test(s) failed.");
}
}
static void test(String algo, Provider provider, boolean priv,
Consumer<Key> method) throws Exception {
KeyPairGenerator generator;
try {
generator = KeyPairGenerator.getInstance(algo, provider);
} catch (NoSuchAlgorithmException nsae) {
return;
}
System.out.println("Checking " + provider.getName() + ", " + algo);
KeyPair pair = generator.generateKeyPair();
Key key = priv ? pair.getPrivate() : pair.getPublic();
pair = null;
for (int i = 0; i < 32; ++i) {
System.gc();
}
try {
method.accept(key);
} catch (ProviderException pe) {
failures++;
}
}
}

View file

@ -0,0 +1,55 @@
/*
* Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4221800
* @library /test/lib
* @summary Test restored generateKeyPair method
*/
import java.security.KeyPairGenerator;
import java.security.KeyPair;
import jdk.test.lib.security.SecurityUtils;
public class GenerateKeypair {
public static void main(String[] args) throws Exception {
String kpgAlgorithm = "DSA";
KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgorithm);
kpg.initialize(SecurityUtils.getTestKeySize(kpgAlgorithm));
// test generateKeyPair
KeyPair kpair = kpg.generateKeyPair();
if (kpair == null) {
throw new Exception("no keypair generated");
}
// test genKeyPair
kpair = kpg.genKeyPair();
if (kpair == null) {
throw new Exception("no keypair generated");
}
}
}

View file

@ -0,0 +1,55 @@
/*
* Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4297026
* @library /test/lib
* @summary Make sure that RSA Keypair generation using
* java.security.spec.RSAKeyGenParameterSpec passes
*/
import java.security.KeyPairGenerator;
import java.security.KeyPair;
import java.security.spec.RSAKeyGenParameterSpec;
import jdk.test.lib.security.SecurityUtils;
public class GenerateRSAKeyPair {
public static void main(String[] args) throws Exception {
String kpgAlgorithm = "RSA";
RSAKeyGenParameterSpec rsaSpec =
new RSAKeyGenParameterSpec (SecurityUtils.getTestKeySize(kpgAlgorithm),
RSAKeyGenParameterSpec.F4);
KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgorithm,
System.getProperty("test.provider.name", "SunRsaSign"));
kpg.initialize(rsaSpec);
// test generateKeyPair
KeyPair kpair = kpg.generateKeyPair();
if (kpair == null) {
throw new Exception("no keypair generated");
}
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,205 @@
/*
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 4532506 4999599
* @library /test/lib
* @summary Serializing KeyPair on one VM (Sun),
* and Deserializing on another (IBM) fails
*/
import java.io.*;
import java.math.BigInteger;
import java.security.*;
import javax.crypto.*;
import javax.crypto.spec.*;
import jdk.test.lib.security.DiffieHellmanGroup;
import jdk.test.lib.security.SecurityUtils;
public class Serial {
// providers
private static final String SUN = System.getProperty("test.provider.name", "SUN");
private static final String RSA = System.getProperty("test.provider.name", "SunRsaSign");
private static final String JCE = System.getProperty("test.provider.name", "SunJCE");
public static void main(String[] args) throws Exception {
// generate DSA key pair
String kpgAlgorithmDsa = "DSA";
KeyPairGenerator kpg = KeyPairGenerator.getInstance(kpgAlgorithmDsa, SUN);
kpg.initialize(SecurityUtils.getTestKeySize(kpgAlgorithmDsa));
KeyPair dsaKp = kpg.genKeyPair();
// serialize DSA key pair
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(baos);
oos.writeObject(dsaKp);
oos.close();
// deserialize DSA key pair
ObjectInputStream ois = new ObjectInputStream
(new ByteArrayInputStream(baos.toByteArray()));
KeyPair dsaKp2 = (KeyPair)ois.readObject();
ois.close();
if (!dsaKp2.getPublic().equals(dsaKp.getPublic()) ||
!dsaKp2.getPrivate().equals(dsaKp.getPrivate())) {
throw new SecurityException("DSA test failed");
}
// generate RSA key pair
String kpgAlgorithmRsa = "RSA";
kpg = KeyPairGenerator.getInstance(kpgAlgorithmRsa, RSA);
kpg.initialize(SecurityUtils.getTestKeySize(kpgAlgorithmRsa));
KeyPair rsaKp = kpg.genKeyPair();
// serialize RSA key pair
baos.reset();
oos = new ObjectOutputStream(baos);
oos.writeObject(rsaKp);
oos.close();
// deserialize RSA key pair
ois = new ObjectInputStream
(new ByteArrayInputStream(baos.toByteArray()));
KeyPair rsaKp2 = (KeyPair)ois.readObject();
ois.close();
if (!rsaKp2.getPublic().equals(rsaKp.getPublic()) ||
!rsaKp2.getPrivate().equals(rsaKp.getPrivate())) {
throw new SecurityException("RSA test failed");
}
// generate DH key pair
DiffieHellmanGroup dhGroup = SecurityUtils.getTestDHGroup();
kpg = KeyPairGenerator.getInstance("DiffieHellman", JCE);
kpg.initialize(new DHParameterSpec(dhGroup.getPrime(), dhGroup.getBase()));
KeyPair dhKp = kpg.genKeyPair();
// serialize DH key pair
baos.reset();
oos = new ObjectOutputStream(baos);
oos.writeObject(dhKp);
oos.close();
// deserialize DH key pair
ois = new ObjectInputStream
(new ByteArrayInputStream(baos.toByteArray()));
KeyPair dhKp2 = (KeyPair)ois.readObject();
ois.close();
if (!dhKp2.getPublic().equals(dhKp.getPublic()) ||
!dhKp2.getPrivate().equals(dhKp.getPrivate())) {
throw new SecurityException("DH test failed");
}
// generate RC5 key
SecretKeySpec rc5Key = new SecretKeySpec(new byte[128], "RC5");
// serialize RC5 key
baos.reset();
oos = new ObjectOutputStream(baos);
oos.writeObject(rc5Key);
oos.close();
// deserialize RC5 key
ois = new ObjectInputStream
(new ByteArrayInputStream(baos.toByteArray()));
SecretKey rc5Key2 = (SecretKey)ois.readObject();
ois.close();
if (!rc5Key.equals(rc5Key2)) {
throw new SecurityException("RC5 test failed");
}
// generate PBE key
// Salt
byte[] salt = {
(byte)0xc7, (byte)0x73, (byte)0x21, (byte)0x8c,
(byte)0x7e, (byte)0xc8, (byte)0xee, (byte)0x99
};
// Iteration count
int count = 20;
// Create PBE parameter set
PBEParameterSpec pbeParamSpec = new PBEParameterSpec(salt, count);
char[] password = new char[] {'f', 'o', 'o'};
PBEKeySpec pbeKeySpec = new PBEKeySpec(password);
SecretKeyFactory keyFac =
SecretKeyFactory.getInstance("PBEWithMD5AndDES", JCE);
SecretKey pbeKey = keyFac.generateSecret(pbeKeySpec);
// serialize PBE key
baos.reset();
oos = new ObjectOutputStream(baos);
oos.writeObject(pbeKey);
oos.close();
// deserialize PBE key
ois = new ObjectInputStream
(new ByteArrayInputStream(baos.toByteArray()));
SecretKey pbeKey2 = (SecretKey)ois.readObject();
ois.close();
if (!pbeKey.equals(pbeKey2)) {
throw new SecurityException("PBE test failed");
}
checkKey("AES", 128);
checkKey("Blowfish", -1);
checkKey("DES", 56);
checkKey("DESede", 168);
checkKey("HmacMD5", -1);
checkKey("HmacSHA1", -1);
}
private static void checkKey(String algorithm, int size) throws Exception {
// generate key
KeyGenerator kg = KeyGenerator.getInstance(algorithm, JCE);
if (size > 0) {
kg.init(size);
}
SecretKey key = kg.generateKey();
// serialize key
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(baos);
oos.writeObject(key);
oos.close();
// deserialize key
ObjectInputStream ois = new ObjectInputStream
(new ByteArrayInputStream(baos.toByteArray()));
SecretKey key2 = (SecretKey)ois.readObject();
ois.close();
if (!key.equals(key2)) {
throw new SecurityException(algorithm + " test failed");
}
}
}

View file

@ -0,0 +1,70 @@
/*
* Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 6232513
* @summary RMI interoperability issue with DSAPublicKey obj between
* JDK1.4 & JDK1.5
* @run main/othervm -Dsun.security.key.serial.interop=true -Dsun.security.pkcs11.enable-solaris=false SerialDSAPubKey
*/
import java.io.*;
import java.math.BigInteger;
import java.security.*;
import javax.crypto.*;
import javax.crypto.spec.*;
public class SerialDSAPubKey {
// provider
private static final String SUN = "SUN";
public static void main(String[] args) throws Exception {
// This test generates sun.security.DSAPublicKey
// (not sun.security.DSAPublicKeyImpl, as Serial.java does)
// generate DSA key pair
KeyPairGenerator kpg = KeyPairGenerator.getInstance("DSA", SUN);
kpg.initialize(512);
KeyPair dsaKp = kpg.genKeyPair();
// serialize DSA key pair
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(baos);
oos.writeObject(dsaKp);
oos.close();
// deserialize DSA key pair
ObjectInputStream ois = new ObjectInputStream
(new ByteArrayInputStream(baos.toByteArray()));
KeyPair dsaKp2 = (KeyPair)ois.readObject();
ois.close();
if (!dsaKp2.getPublic().equals(dsaKp.getPublic()) ||
!dsaKp2.getPrivate().equals(dsaKp.getPrivate())) {
throw new SecurityException("DSA test failed");
}
}
}

View file

@ -0,0 +1,77 @@
/*
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test 1.1, 03/08/13
* @bug 4532506 8301126
* @summary Serializing KeyPair on one VM (Sun),
* and Deserializing on another (IBM) fails
*/
import java.io.*;
public class SerialOld {
public static void main(String[] args) throws Exception {
// verify tiger DSA and RSA public keys still deserialize in our VM
deserializeTigerKey("DSA");
deserializeTigerKey("RSA");
// verify pre-tiger keys still deserialize in our VM.
// There used to be a RSA test here, but the serialized file contained
// classes introduced in JDK 5.0 (sun.security.rsa.RSA*). The older
// RSA keys from JDK 1.4.2 were of class JSA_* which were removed when
// sun.security.rsa was introduced. (See JDK-8301126 for more
// details.) The test/data has been removed.
deserializeKey("DSA");
deserializeKey("DH");
deserializeKey("AES");
deserializeKey("Blowfish");
deserializeKey("DES");
deserializeKey("DESede");
deserializeKey("RC5");
deserializeKey("HmacSHA1");
deserializeKey("HmacMD5");
deserializeKey("PBE");
}
private static void deserializeTigerKey(String algorithm) throws Exception {
ObjectInputStream ois = new ObjectInputStream(new FileInputStream
(System.getProperty("test.src", ".") +
File.separator +
algorithm + ".1.5.key"));
ois.readObject();
ois.close();
}
private static void deserializeKey(String algorithm) throws Exception {
ObjectInputStream ois = new ObjectInputStream(new FileInputStream
(System.getProperty("test.src", ".") +
File.separator +
algorithm + ".pre.1.5.key"));
ois.readObject();
ois.close();
}
}

View file

@ -0,0 +1,49 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 8136534
* @summary The input stream supplied to KeyStore.load should remain open.
*/
import java.io.*;
import java.security.*;
public class CheckInputStream {
private final static String DIR = System.getProperty("test.src", ".");
private static final char[] PASSWORD = "passphrase".toCharArray();
private static final String KEYSTORE = DIR + "/keystore.jks";
public static final void main(String[] args) throws Exception {
KeyStore keystore = KeyStore.getInstance("JKS");
try (FileInputStream inStream = new FileInputStream(KEYSTORE)) {
System.out.println("Loading JKS keystore: " + KEYSTORE);
keystore.load(inStream, PASSWORD);
// check that the stream is still open
inStream.available();
System.out.println("OK");
}
}
}

View file

@ -0,0 +1,137 @@
/*
* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import java.security.KeyStore;
import java.util.HashSet;
import java.util.Set;
import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.process.ProcessTools;
/*
* @test
* @bug 8303465 8320362
* @library /test/lib
* @requires os.family == "mac"
* @summary Check whether loading of certificates from MacOS Keychain correctly
* honors trust settings
* @run main CheckMacOSKeyChainTrust KEYCHAINSTORE
* @run main CheckMacOSKeyChainTrust KEYCHAINSTORE-ROOT
*/
public class CheckMacOSKeyChainTrust {
private static Set<String> trusted = new HashSet<>();
private static Set<String> distrusted = new HashSet<>();
public static void main(String[] args) throws Throwable {
String keystore = args[0];
if (keystore.equals("KEYCHAINSTORE")) {
loadUser(true);
loadAdmin(true);
} else {
// check user and admin trustsettings to find distrusted certs
loadUser(false);
loadAdmin(false);
loadSystem(true);
}
System.out.println("Trusted Certs: " + trusted);
System.out.println("Distrusted Certs: " + distrusted);
KeyStore ks = KeyStore.getInstance(keystore);
ks.load(null, null);
for (String alias : trusted) {
if (!ks.containsAlias(alias)) {
throw new RuntimeException("Not found: " + alias);
}
}
for (String alias : distrusted) {
if (ks.containsAlias(alias)) {
throw new RuntimeException("Found: " + alias);
}
}
}
private static void loadUser(boolean addTrusted) throws Throwable {
populate(ProcessTools.executeProcess("security", "dump-trust-settings"), addTrusted);
}
private static void loadAdmin(boolean addTrusted) throws Throwable {
populate(ProcessTools.executeProcess("security", "dump-trust-settings", "-d"), addTrusted);
}
private static void loadSystem(boolean addTrusted) throws Throwable {
populate(ProcessTools.executeProcess("security", "dump-trust-settings", "-s"), addTrusted);
}
private static void populate(OutputAnalyzer output, boolean addTrusted) throws Throwable {
if (output.getExitValue() != 0) {
return; // No Trust Settings were found
}
String certName = null;
boolean trustRootFound = false;
boolean trustAsRootFound = false;
boolean denyFound = false;
boolean unspecifiedFound = false;
for (String line : output.asLines()) {
if (line.startsWith("Cert ")) {
if (certName != null) {
if (!denyFound &&
!(unspecifiedFound && !(trustRootFound || trustAsRootFound)) &&
!distrusted.contains(certName)) {
if (addTrusted) {
trusted.add(certName);
}
} else {
distrusted.add(certName);
trusted.remove(certName);
}
}
certName = line.split(":", 2)[1].trim().toLowerCase();
trustRootFound = false;
trustAsRootFound = false;
denyFound = false;
unspecifiedFound = false;
} else if (line.contains("kSecTrustSettingsResultTrustRoot")) {
trustRootFound = true;
} else if (line.contains("kSecTrustSettingsResultTrustAsRoot")) {
trustAsRootFound = true;
} else if (line.contains("kSecTrustSettingsResultDeny")) {
denyFound = true;
} else if (line.contains("kSecTrustSettingsResultUnspecified")) {
unspecifiedFound = true;
}
}
if (certName != null) {
if (!denyFound &&
!(unspecifiedFound && !(trustRootFound || trustAsRootFound)) &&
!distrusted.contains(certName)) {
if (addTrusted) {
trusted.add(certName);
}
} else {
distrusted.add(certName);
trusted.remove(certName);
}
}
}
}

View file

@ -0,0 +1,235 @@
/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test 1.1, 03/06/24
* @bug 4850376
* @summary Provide generic storage KeyStore storage facilities
*/
import java.security.KeyStore;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.Principal;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.security.SignatureException;
import java.security.cert.Certificate;
import java.security.cert.X509Certificate;
import java.security.cert.CertificateException;
import java.security.cert.CertificateExpiredException;
import java.security.cert.CertificateEncodingException;
import java.security.cert.CertificateNotYetValidException;
import java.security.cert.X509Certificate;
import java.util.Date;
import java.util.Set;
import java.util.HashSet;
import java.math.BigInteger;
import javax.security.auth.x500.X500Principal;
public class DefaultEntryType {
private static class PrivKey1 implements PrivateKey {
public String getAlgorithm() { return ("matching_alg"); }
public String getFormat() { return "privkey1"; }
public byte[] getEncoded() { return (byte[])null; }
}
private static class PubKey1 implements PublicKey {
public String getAlgorithm() { return ("non_matching_alg"); }
public String getFormat() { return "pubkey1"; }
public byte[] getEncoded() { return (byte[])null; }
}
private static class PubKey2 implements PublicKey {
public String getAlgorithm() { return ("matching_alg"); }
public String getFormat() { return "pubkey2"; }
public byte[] getEncoded() { return (byte[])null; }
}
private static class Cert extends Certificate {
public Cert() { super("cert"); }
public byte[] getEncoded()
throws CertificateEncodingException { return (byte[])null; }
public void verify(PublicKey key)
throws CertificateException, NoSuchAlgorithmException,
InvalidKeyException, NoSuchProviderException,
SignatureException { }
public void verify(PublicKey key, String sigProvider)
throws CertificateException, NoSuchAlgorithmException,
InvalidKeyException, NoSuchProviderException,
SignatureException { }
public String toString() { return "cert"; }
public PublicKey getPublicKey() { return new PubKey1(); }
}
private static class X509Cert extends X509Certificate {
public byte[] getEncoded()
throws CertificateEncodingException { return (byte[])null; }
public void verify(PublicKey key)
throws CertificateException, NoSuchAlgorithmException,
InvalidKeyException, NoSuchProviderException,
SignatureException { }
public void verify(PublicKey key, String sigProvider)
throws CertificateException, NoSuchAlgorithmException,
InvalidKeyException, NoSuchProviderException,
SignatureException { }
public String toString() { return "x509cert"; }
public PublicKey getPublicKey() { return new PubKey2(); }
public void checkValidity()
throws CertificateExpiredException,
CertificateNotYetValidException { }
public void checkValidity(java.util.Date date)
throws CertificateExpiredException,
CertificateNotYetValidException { }
public int getVersion() { return 1; }
public BigInteger getSerialNumber() { return new BigInteger("5", 10); }
public Principal getIssuerDN()
{ return new X500Principal("cn=x509cert"); }
public X500Principal getIssuerX500Principal()
{ return new X500Principal("cn=x509cert"); }
public Principal getSubjectDN()
{ return new X500Principal("cn=x509cert"); }
public X500Principal getSubjectX500Principal()
{ return new X500Principal("cn=x509cert"); }
public Date getNotBefore() { return new Date(); }
public Date getNotAfter() { return new Date(); }
public byte[] getTBSCertificate() throws CertificateEncodingException
{ return (byte[])null; }
public byte[] getSignature() { return (byte[])null; }
public String getSigAlgName() { return "x509cert"; }
public String getSigAlgOID() { return "x509cert"; }
public byte[] getSigAlgParams() { return (byte[])null; }
public boolean[] getIssuerUniqueID() { return (boolean[])null; }
public boolean[] getSubjectUniqueID() { return (boolean[])null; }
public boolean[] getKeyUsage() { return (boolean[]) null; }
public int getBasicConstraints() { return 1; }
public boolean hasUnsupportedCriticalExtension() { return true; }
public Set getCriticalExtensionOIDs() { return new HashSet(); }
public Set getNonCriticalExtensionOIDs() { return new HashSet(); }
public byte[] getExtensionValue(String oid) { return (byte[])null; }
}
public static void main(String[] args) throws Exception {
testPrivateKeyEntry();
testSecretKeyEntry();
testTrustedCertificateEntry();
}
private static void testPrivateKeyEntry() throws Exception {
// TEST null private key
try {
Certificate[] chain = new Certificate[0];
KeyStore.PrivateKeyEntry pke = new KeyStore.PrivateKeyEntry
(null, chain);
throw new SecurityException("test 1 failed");
} catch (NullPointerException npe) {
// good
System.out.println("test 1 passed");
}
// TEST null chain
try {
KeyStore.PrivateKeyEntry pke = new KeyStore.PrivateKeyEntry
(new PrivKey1(), null);
throw new SecurityException("test 2 failed");
} catch (NullPointerException npe) {
// good
System.out.println("test 2 passed");
}
// TEST empty chain
try {
Certificate[] chain = new Certificate[0];
KeyStore.PrivateKeyEntry pke = new KeyStore.PrivateKeyEntry
(new PrivKey1(), chain);
throw new SecurityException("test 3 failed");
} catch (IllegalArgumentException npe) {
// good
System.out.println("test 3 passed");
}
// TEST non-homogenous chain
try {
Certificate[] chain = new Certificate[2];
chain[0] = new Cert();
chain[1] = new X509Cert();
KeyStore.PrivateKeyEntry pke = new KeyStore.PrivateKeyEntry
(new PrivKey1(), chain);
throw new SecurityException("test 4 failed");
} catch (IllegalArgumentException npe) {
// good
System.out.println("test 4 passed");
}
// TEST non matching algorithms
try {
Certificate[] chain = new Certificate[1];
chain[0] = new Cert();
KeyStore.PrivateKeyEntry pke = new KeyStore.PrivateKeyEntry
(new PrivKey1(), chain);
throw new SecurityException("test 5 failed");
} catch (IllegalArgumentException npe) {
// good
System.out.println("test 5 passed");
}
// TEST correct behavior
Certificate[] chain = new Certificate[2];
chain[0] = new X509Cert();
chain[1] = new X509Cert();
PrivateKey pkey = new PrivKey1();
KeyStore.PrivateKeyEntry pke = new KeyStore.PrivateKeyEntry
(pkey, chain);
Certificate[] gotChain = pke.getCertificateChain();
if (gotChain instanceof X509Certificate[]) {
System.out.println("test 6 passed");
} else {
throw new SecurityException("test 6 failed");
}
if (gotChain.length == 2 &&
gotChain[0] == chain[0] &&
gotChain[1] == chain[1]) {
System.out.println("test 7 passed");
} else {
throw new SecurityException("test 7 failed");
}
if (pke.getPrivateKey() == pkey) {
System.out.println("test 8 passed");
} else {
throw new SecurityException("test 8 failed");
}
}
private static void testSecretKeyEntry() throws Exception {
}
private static void testTrustedCertificateEntry() throws Exception {
}
}

View file

@ -0,0 +1,53 @@
/*
* Copyright (c) 2026, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* @test
* @bug 8373690
* @summary verify that the exception message indicates the keystore type
* when the type is disabled instead of being unrecognized
* @run main/othervm -Djdk.crypto.disabledAlgorithms=KeyStore.PKCS12 DisabledKnownType
*/
import java.security.KeyStore;
import java.security.KeyStoreException;
public class DisabledKnownType {
public static void main(String[] args) throws Exception {
String cacertsPath = System.getProperty("java.home") +
"/lib/security/cacerts";
try {
KeyStore ks = KeyStore.getInstance(new java.io.File(cacertsPath),
"changeit".toCharArray());
throw new RuntimeException("Expected KeyStoreException not thrown");
} catch (KeyStoreException kse) {
if (kse.getMessage().contains("PKCS12")) {
System.out.println("Passed: expected ex thrown: " + kse);
} else {
// pass it up
throw kse;
}
}
}
}

View file

@ -0,0 +1,578 @@
/*
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test 1.5, 03/06/24
* @bug 4850376 8130850 8130181
* @summary Provide generic storage KeyStore storage facilities
*/
import java.security.*;
import java.security.cert.*;
import java.util.*;
import java.io.*;
public class EntryMethods
extends Provider
implements KeyStore.Entry
{
private static FileInputStream pre15fis;
private static char[] password = {'f', 'o', 'o', 'b', 'a', 'r'};
private static char[] badPwd = {'b', 'a', 'd', 'p', 'w', 'd'};
public static class FooProtect implements KeyStore.ProtectionParameter { }
public static class FooParameter implements KeyStore.LoadStoreParameter {
public KeyStore.ProtectionParameter getProtectionParameter() {
return null;
}
}
public static class MyLoadStoreParameter
implements KeyStore.LoadStoreParameter {
private KeyStore.ProtectionParameter protection;
MyLoadStoreParameter(KeyStore.ProtectionParameter protection) {
this.protection = protection;
}
public KeyStore.ProtectionParameter getProtectionParameter() {
return protection;
}
}
public static class FooEntry implements KeyStore.Entry { }
public EntryMethods() throws Exception {
super("EntryMethods", "0.0", "EntryMethods");
pre15fis = new FileInputStream
(System.getProperty("test.src") + "/EntryMethods.pre15.keystore");
put("KeyStore.Pre15KeyStore", "EntryMethods$Pre15");
put("KeyStore.Post15KeyStore", "EntryMethods$Post15");
put("KeyStore.UnrecoverableKeyStore", "EntryMethods$UnrecoverableKS");
}
public static void main(String[] args) throws Exception {
EntryMethods entry = new EntryMethods();
// test pre-JDK1.5 KeyStore throws UnsupportedOperationExceptions
// for new methods
KeyStore pre15KS = KeyStore.getInstance("Pre15KeyStore", entry);
testPre15(pre15KS);
// test post-JDK1.5 KeyStore does right thing with new methods
KeyStore post15KS = KeyStore.getInstance("Post15KeyStore", entry);
testPost15(post15KS);
// test post-JDK1.5 KeyStore can throw new UnrecoverableEntryException
KeyStore uKS = KeyStore.getInstance("UnrecoverableKeyStore", entry);
testUnrecoverable(uKS);
}
private static void testPre15(KeyStore ks) throws Exception {
int tNum = 1;
KeyStore.Entry e = null;
// TEST load null param
ks.load((KeyStore.LoadStoreParameter)null);
System.out.println("[Pre1.5] test " + tNum++ + " passed");
// TEST load random param
try {
ks.load(new FooParameter());
throw new SecurityException("[Pre1.5] test " + tNum + " failed");
} catch (UnsupportedOperationException uoe) {
System.out.println("[Pre1.5] test " + tNum++ + " passed");
} catch (NoSuchAlgorithmException nsae) {
System.out.println("[Pre1.5] test " + tNum++ + " passed");
}
// TEST load custom param
ks.load(new MyLoadStoreParameter(
new KeyStore.PasswordProtection(password)));
System.out.println("[Pre1.5] test " + tNum++ + " passed");
// TEST store random param
ks.load(pre15fis, password);
// setup for later user
KeyStore.Entry pkeNew = ks.getEntry("privkey",
new KeyStore.PasswordProtection(password));
KeyStore.Entry tceNew = ks.getEntry("trustedcert", null);
try {
ks.store(new FooParameter());
throw new SecurityException("[Pre1.5] test " + tNum + " failed");
} catch (UnsupportedOperationException uoe) {
// good
System.out.println("[Pre1.5] test " + tNum++ + " passed");
}
// TEST store null param
try {
ks.store(null);
throw new SecurityException("[Pre1.5] test " + tNum + " failed");
} catch (UnsupportedOperationException uoe) {
// good
System.out.println("[Pre1.5] test " + tNum++ + " passed");
}
// TEST getEntry with alias/protParam - use invalid alias
e = ks.getEntry("notPresent",
new KeyStore.PasswordProtection(password));
if (e == null) {
System.out.println("[Pre1.5] test " + tNum++ + " passed");
} else {
throw new SecurityException("[Pre1.5] test " + tNum + " failed - " +
"expected null entry returned");
}
// TEST getEntry with alias/null protParam - get private key
try {
e = ks.getEntry("privkey", null);
throw new SecurityException("[Pre1.5] test " + tNum + " failed - " +
"expected UnrecoverableEntryException");
} catch (UnrecoverableEntryException uee) {
System.out.println("[Pre1.5] test " + tNum++ + " passed");
}
// TEST getEntry with alias/bad password - get private key
try {
e = ks.getEntry("privkey",
new KeyStore.PasswordProtection(badPwd));
throw new SecurityException("[Pre1.5] test " + tNum + " failed - " +
"expected UnrecoverableEntryException");
} catch (UnrecoverableEntryException uee) {
System.out.println("[Pre1.5] test " + tNum++ + " passed");
}
// TEST getEntry with alias/unknown protection - get private key
try {
e = ks.getEntry("privkey", new FooProtect());
throw new SecurityException("[Pre1.5] test " + tNum + " failed - " +
"expected UnsupportedOperationException");
} catch (UnsupportedOperationException uoe) {
System.out.println("[Pre1.5] test " + tNum++ + " passed");
}
// TEST getEntry with alias/protParam - get private key
e = ks.getEntry("privkey", new KeyStore.PasswordProtection(password));
if (e instanceof KeyStore.PrivateKeyEntry) {
System.out.println("[Pre1.5] test " + tNum++ + " passed");
} else {
throw new SecurityException("[Pre1.5] test " + tNum + " failed - " +
"expected PrivateKeyEntry");
}
// TEST getEntry with alias/null protParam - get trusted cert
e = ks.getEntry("trustedcert", null);
if (e instanceof KeyStore.TrustedCertificateEntry) {
System.out.println("[Pre1.5] test " + tNum++ + " passed");
} else {
throw new SecurityException("[Pre1.5] test " + tNum + " failed");
}
// TEST getEntry with alias/non-null protParam - get trusted cert
try {
e = ks.getEntry("trustedcert",
new KeyStore.PasswordProtection(password));
throw new SecurityException("[Pre1.5] test " + tNum + " failed");
} catch (UnsupportedOperationException uoe) {
System.out.println("[Pre1.5] test " + tNum++ + " passed");
}
// TEST setEntry with alias/entry/protParam - use invalid alias
try {
ks.setEntry("foo", new FooEntry(),
new KeyStore.PasswordProtection(password));
throw new SecurityException("[Pre1.5] test " + tNum + " failed - " +
"expected KeyStoreException");
} catch (KeyStoreException kse) {
// good
System.out.println("[Pre1.5] test " + tNum++ + " passed");
}
// TEST setEntry with alias/entry/null protParam - set private key
try {
ks.setEntry("newPrivKey", pkeNew, null);
throw new SecurityException("[Pre1.5] test " + tNum + " failed - " +
"expected KeyStoreException");
} catch (KeyStoreException kse) {
System.out.println("[Pre1.5] test " + tNum++ + " passed");
}
// TEST setEntry with alias/entry/random protParam - set private key
try {
ks.setEntry("newPrivKey", pkeNew, new FooProtect());
throw new SecurityException("[Pre1.5] test " + tNum + " failed - " +
"expected KeyStoreException");
} catch (KeyStoreException kse) {
System.out.println("[Pre1.5] test " + tNum++ + " passed");
}
// TEST setEntry with alias/entry/protParam - set private key
ks.setEntry("newPrivKey", pkeNew,
new KeyStore.PasswordProtection(password));
e = ks.getEntry("newPrivKey",
new KeyStore.PasswordProtection(password));
if (e instanceof KeyStore.PrivateKeyEntry) {
System.out.println("[Pre1.5] test " + tNum++ + " passed");
} else {
throw new SecurityException("[Pre1.5] test " + tNum + " failed - " +
"expected PrivateKeyEntry");
}
// TEST setEntry with alias/entry/non null protParam - set trusted cert
try {
ks.setEntry("newTrustedcert", tceNew,
new KeyStore.PasswordProtection(password));
throw new SecurityException("[Pre1.5] test " + tNum + " failed - " +
"expected KeyStoreException");
} catch (KeyStoreException kse) {
// good
System.out.println("[Pre1.5] test " + tNum++ + " passed");
}
// TEST setEntry with alias/entry/null protParam - set trusted cert
ks.setEntry("newTrustedcert", tceNew, null);
e = ks.getEntry("newTrustedcert", null);
if (e instanceof KeyStore.TrustedCertificateEntry) {
System.out.println("[Pre1.5] test " + tNum++ + " passed");
} else {
throw new SecurityException("[Pre1.5] test " + tNum + " failed - " +
"expected TrustedCertificateEntry");
}
// TEST entryInstanceOf - invalid alias
if (ks.entryInstanceOf("foo", EntryMethods.class) == false) {
System.out.println("[Pre1.5] test " + tNum++ + " passed");
} else {
throw new SecurityException("[Pre1.5] test " + tNum + " failed");
}
// TEST entryInstanceOf - false case
if (ks.entryInstanceOf("privkey", EntryMethods.class) == false) {
System.out.println("[Pre1.5] test " + tNum++ + " passed");
} else {
throw new SecurityException("[Pre1.5] test " + tNum + " failed");
}
// TEST entryInstanceOf - true case, trustedcert entry
if (ks.entryInstanceOf("trustedcert",
KeyStore.TrustedCertificateEntry.class)) {
System.out.println("[Pre1.5] test " + tNum++ + " passed");
} else {
throw new SecurityException("[Pre1.5] test " + tNum + " failed");
}
// TEST entryInstanceOf - true case, private key entry
if (ks.entryInstanceOf("privkey",
KeyStore.PrivateKeyEntry.class)) {
System.out.println("[Pre1.5] test " + tNum++ + " passed");
} else {
throw new SecurityException("[Pre1.5] test " + tNum + " failed");
}
}
private static void testPost15(KeyStore ks) throws Exception {
KeyStore.Entry e = null;
ks.load(new EntryMethods.FooParameter());
ks.store(new EntryMethods.FooParameter());
e = ks.getEntry("foo", new KeyStore.PasswordProtection(password));
if (!(e instanceof EntryMethods.FooEntry)) {
throw new SecurityException
("testPost15 getEntry(String, ProtParm) " +
"expected EntryMethods.FooEntry returned");
}
ks.setEntry("foo", new EntryMethods.FooEntry(),
new KeyStore.PasswordProtection(password));
if (!ks.entryInstanceOf("foo", KeyStore.PrivateKeyEntry.class)) {
throw new SecurityException
("testPost15 entryInstanceOf(String, Class) " +
"expected true returned");
}
System.out.println("[Post1.5] tests all passed");
}
private static void testUnrecoverable(KeyStore ks) throws Exception {
ks.load(new EntryMethods.FooParameter());
try {
ks.getEntry("foo", new KeyStore.PasswordProtection(password));
throw new SecurityException
("UnrecoverableEntryException not thrown for " +
"getEntry(String, ProtectionParam)");
} catch (UnrecoverableEntryException uee) {
// good
System.out.println("[UnrecoverableEntry] test passed");
}
}
public static class Pre15 extends KeyStoreSpi {
private static KeyStore jks = getJKS();
private static KeyStore getJKS() {
try {
return (KeyStore) KeyStore.getInstance("JKS");
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException(e);
}
}
public Pre15() {
}
public Key engineGetKey(String alias, char[] password)
throws NoSuchAlgorithmException, UnrecoverableKeyException {
try {
return jks.getKey(alias, password);
} catch (KeyStoreException ke) {
throw new RuntimeException("Unexpected exception", ke);
}
}
public java.security.cert.Certificate[] engineGetCertificateChain
(String alias) {
try {
return jks.getCertificateChain(alias);
} catch (KeyStoreException ke) {
throw new RuntimeException("Unexpected exception", ke);
}
}
public java.security.cert.Certificate engineGetCertificate
(String alias) {
try {
return jks.getCertificate(alias);
} catch (KeyStoreException ke) {
throw new RuntimeException("Unexpected exception", ke);
}
}
public Date engineGetCreationDate(String alias) {
try {
return jks.getCreationDate(alias);
} catch (KeyStoreException ke) {
throw new RuntimeException("Unexpected exception", ke);
}
}
public void engineSetKeyEntry(String alias, Key key,
char[] password,
java.security.cert.Certificate[] chain)
throws KeyStoreException {
jks.setKeyEntry(alias, key, password, chain);
}
public void engineSetKeyEntry(String alias, byte[] key,
java.security.cert.Certificate[] chain)
throws KeyStoreException {
jks.setKeyEntry(alias, key, chain);
}
public void engineSetCertificateEntry(String alias,
java.security.cert.Certificate cert)
throws KeyStoreException {
jks.setCertificateEntry(alias, cert);
}
public void engineDeleteEntry(String alias)
throws KeyStoreException {
jks.deleteEntry(alias);
}
public Enumeration engineAliases() {
try {
return jks.aliases();
} catch (KeyStoreException ke) {
throw new RuntimeException("Unexpected exception", ke);
}
}
public boolean engineContainsAlias(String alias) {
try {
return jks.containsAlias(alias);
} catch (KeyStoreException ke) {
throw new RuntimeException("Unexpected exception", ke);
}
}
public int engineSize() {
try {
return jks.size();
} catch (KeyStoreException ke) {
throw new RuntimeException("Unexpected exception", ke);
}
}
public boolean engineIsKeyEntry(String alias) {
try {
return jks.isKeyEntry(alias);
} catch (KeyStoreException ke) {
throw new RuntimeException("Unexpected exception", ke);
}
}
public boolean engineIsCertificateEntry(String alias) {
try {
return jks.isCertificateEntry(alias);
} catch (KeyStoreException ke) {
throw new RuntimeException("Unexpected exception", ke);
}
}
public String engineGetCertificateAlias
(java.security.cert.Certificate cert) {
try {
return jks.getCertificateAlias(cert);
} catch (KeyStoreException ke) {
throw new RuntimeException("Unexpected exception", ke);
}
}
public void engineStore(OutputStream stream, char[] password)
throws IOException, NoSuchAlgorithmException, CertificateException {
try {
jks.store(stream, password);
} catch (KeyStoreException ke) {
throw new RuntimeException("Unexpected exception", ke);
}
}
public void engineLoad(InputStream stream, char[] password)
throws IOException, NoSuchAlgorithmException, CertificateException {
jks.load(stream, password);
}
}
public static class Post15 extends Pre15 {
public void engineStore(KeyStore.LoadStoreParameter parameter)
throws IOException, NoSuchAlgorithmException, CertificateException {
if (!(parameter instanceof EntryMethods.FooParameter)) {
throw new IOException("Post15 engineStore method expected " +
"FooParameter");
}
}
public void engineLoad(KeyStore.LoadStoreParameter parameter)
throws IOException, NoSuchAlgorithmException, CertificateException {
if (!(parameter instanceof EntryMethods.FooParameter)) {
throw new IOException("Post15 engineLoadFrom method expected " +
"FooParameter");
}
}
public KeyStore.Entry engineGetEntry(String alias,
KeyStore.ProtectionParameter protectionParam)
throws UnrecoverableEntryException {
if (!alias.equals("foo")) {
throw new SecurityException
("Post15 engineGetEntry(String, ProtectionParam) " +
"expected [foo] alias");
}
KeyStore.PasswordProtection pwdParam =
(KeyStore.PasswordProtection)protectionParam;
if (pwdParam.getPassword().length != 6) {
throw new SecurityException
("Post15 engineGetEntry(String, ProtectionParam) " +
"expected [foobar] password");
}
return new EntryMethods.FooEntry();
}
public void engineSetEntry(String alias, KeyStore.Entry entry,
KeyStore.ProtectionParameter protectionParam) {
if (!alias.equals("foo") ||
!(entry instanceof EntryMethods.FooEntry)) {
throw new SecurityException
("Post15 engineSetEntry(String, entry, ProtParm) " +
"expected [foo] alias and EntryMethods.FooEntry");
}
KeyStore.PasswordProtection pwdParam =
(KeyStore.PasswordProtection)protectionParam;
if (pwdParam.getPassword().length != 6) {
throw new SecurityException
("Post15 engineSetEntry(String, entry, ProtParm) " +
"expected [foobar] password");
}
}
public boolean engineEntryInstanceOf(String alias,
Class<? extends KeyStore.Entry> entryClass)
{
if (!alias.equals("foo") ||
entryClass != KeyStore.PrivateKeyEntry.class) {
throw new SecurityException
("Post15 engineEntryInstanceOf(String, Class) " +
"expected [foo] alias " +
"and [KeyStore.PrivateKeyEntry] class");
}
return true;
}
}
public static class UnrecoverableKS extends Post15 {
public KeyStore.Entry engineGetEntry(String alias,
KeyStore.ProtectionParameter protectionParam)
throws UnrecoverableEntryException {
throw new UnrecoverableEntryException();
}
}
}

View file

@ -0,0 +1,227 @@
/*
* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* @test
* @bug 4938922 4961104 5071293 6236533 8130181
* @summary verify that the KeyStore.Builder API works
* @author Andreas Sterbenz
*/
import java.io.*;
import java.util.*;
import java.security.*;
import java.security.KeyStore.*;
import java.security.cert.*;
import java.security.cert.Certificate;
import javax.security.auth.callback.*;
public class KeyStoreBuilder {
private final static String DIR = System.getProperty("test.src", ".");
private static final char[] password = "passphrase".toCharArray();
private static final char[] wrongPassword = "wrong".toCharArray();
public static void main(String[] args) throws Exception {
File KSFILE = new File(DIR, "keystore.jks");
KeyStore ks;
String alias = "vajra";
Entry entry = null;
Builder builder;
builder = Builder.newInstance("JKS", null, KSFILE, new PasswordProtection(password));
ks = builder.getKeyStore();
System.out.println("-KeyStore: " + ks.size());
entry = ks.getEntry(alias, builder.getProtectionParameter(alias));
showEntry(entry);
builder = Builder.newInstance("JKS", Security.getProvider("Sun"), KSFILE,
new CallbackHandlerProtection(new DummyHandler()));
ks = builder.getKeyStore();
System.out.println("-KeyStore: " + ks.size());
entry = ks.getEntry(alias, builder.getProtectionParameter(alias));
showEntry(entry);
builder = Builder.newInstance("JKS", null, new PasswordProtection(password));
ks = builder.getKeyStore();
int k = ks.size();
System.out.println("-KeyStore: " + k);
if (k != 0) {
throw new Exception("Size not zero: " + k);
}
DummyHandler handler = new DummyHandler();
handler.useWrongPassword = 2;
builder = Builder.newInstance("JKS", null, KSFILE, new CallbackHandlerProtection(handler));
ks = builder.getKeyStore();
System.out.println("-KeyStore: " + ks.size());
entry = ks.getEntry(alias, builder.getProtectionParameter(alias));
showEntry(entry);
handler.useWrongPassword = 3;
builder = Builder.newInstance("JKS", null, KSFILE, new CallbackHandlerProtection(handler));
try {
ks = builder.getKeyStore();
throw new Exception("should not succeed");
} catch (KeyStoreException e) {
System.out.println(e);
}
try {
ks = builder.getKeyStore();
throw new Exception("should not succeed");
} catch (KeyStoreException e) {
System.out.println(e);
}
Provider p = new MyProvider();
handler.useWrongPassword = 2;
builder = Builder.newInstance("My", p, new CallbackHandlerProtection(handler));
ks = builder.getKeyStore();
k = ks.size();
System.out.println("-KeyStore: " + k);
if (k != 0) {
throw new Exception("Size not zero: " + k);
}
handler.useWrongPassword = 3;
builder = Builder.newInstance("My", p, new CallbackHandlerProtection(handler));
try {
ks = builder.getKeyStore();
throw new Exception("should not succeed");
} catch (KeyStoreException e) {
System.out.println(e);
}
try {
ks = builder.getKeyStore();
throw new Exception("should not succeed");
} catch (KeyStoreException e) {
System.out.println(e);
}
System.out.println("-OK");
}
private static void showEntry(Entry entry) {
PrivateKeyEntry pke = (PrivateKeyEntry)entry;
X509Certificate cert = (X509Certificate)pke.getCertificate();
System.out.println("subject: " + cert.getSubjectX500Principal());
}
private static class DummyHandler implements CallbackHandler {
int useWrongPassword;
public void handle(Callback[] callbacks)
throws IOException, UnsupportedCallbackException {
System.out.println("** Callbackhandler invoked");
for (int i = 0; i < callbacks.length; i++) {
Callback cb = callbacks[i];
if (cb instanceof PasswordCallback) {
System.out.println("Found PasswordCallback");
PasswordCallback pcb = (PasswordCallback)cb;
if (useWrongPassword == 0) {
pcb.setPassword(password);
} else {
pcb.setPassword(wrongPassword);
useWrongPassword--;
}
break;
}
}
}
}
private static class BaseKeyStoreSpi extends KeyStoreSpi {
public Key engineGetKey(String alias, char[] password) {
return null;
}
public Certificate[] engineGetCertificateChain(String alias) {
return null;
}
public Certificate engineGetCertificate(String alias) {
return null;
}
public Date engineGetCreationDate(String alias) {
return null;
}
public void engineSetKeyEntry(String alias, Key key, char[] password, Certificate[] certs) {
//
}
public void engineSetKeyEntry(String alias, byte[] key, Certificate[] certs) {
//
}
public void engineSetCertificateEntry(String alias, Certificate cert) {
//
}
public void engineDeleteEntry(String alias) {
//
}
public Enumeration<String> engineAliases() {
return new Vector<String>().elements();
}
public boolean engineContainsAlias(String alias) {
return false;
}
public int engineSize() {
return 0;
}
public boolean engineIsKeyEntry(String alias) {
return false;
}
public boolean engineIsCertificateEntry(String alias) {
return false;
}
public String engineGetCertificateAlias(Certificate cert) {
return null;
}
public void engineStore(OutputStream stream, char[] password) {
//
}
public void engineLoad(InputStream stream, char[] password) throws IOException {
//
}
}
public static class MyKeyStoreSpi extends BaseKeyStoreSpi {
public void engineLoad(InputStream stream, char[] pw) throws IOException {
if (Arrays.equals(password, pw) == false) {
Throwable t = new UnrecoverableKeyException("Wrong password: " + new String(pw));
throw (IOException)new IOException("load() failed").initCause(t);
}
}
}
private static class MyProvider extends Provider {
MyProvider() {
super("My", "1.0", null);
put("KeyStore.My", "KeyStoreBuilder$MyKeyStoreSpi");
}
}
}

View file

@ -0,0 +1,92 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 8245679
* @summary KeyStore cannot probe PKCS12 keystore if BouncyCastle is the top security provider
* @run main/othervm OneProbeOneNot
*/
import java.io.File;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.security.*;
import java.security.cert.Certificate;
import java.util.Date;
import java.util.Enumeration;
public class OneProbeOneNot {
public static final void main(String[] args) throws Exception {
Files.write(Path.of("ks"), "".getBytes());
// 1st provider do not support probe
Security.insertProviderAt(new P1(), 1);
// 2nd provider support probe
Security.insertProviderAt(new P2(), 2);
KeyStore ks = KeyStore.getInstance(new File("ks"), (char[])null);
System.out.println(ks.getProvider().getName());
System.out.println(ks.getType());
}
public static class P1 extends Provider {
public P1() {
super("P1", "P1", "P1");
putService(new Service(this, "KeyStore", "Oops",
K1.class.getName(), null, null));
}
}
public static class P2 extends Provider {
public P2() {
super("P2", "P2", "P2");
putService(new Service(this, "KeyStore", "Oops",
K2.class.getName(), null, null));
}
}
public static class K1 extends KeyStoreSpi {
public Key engineGetKey(String a, char[] p) { return null; }
public Certificate[] engineGetCertificateChain(String a) { return null; }
public Certificate engineGetCertificate(String a) { return null; }
public Date engineGetCreationDate(String a) { return null; }
public void engineSetKeyEntry(String a, Key k, char[] p, Certificate[] c) { }
public void engineSetKeyEntry(String a, byte[] k, Certificate[] c) { }
public void engineSetCertificateEntry(String a, Certificate c) { }
public void engineDeleteEntry(String a) { }
public Enumeration<String> engineAliases() { return null; }
public boolean engineContainsAlias(String a) { return false; }
public int engineSize() { return 0; }
public boolean engineIsKeyEntry(String a) { return false; }
public boolean engineIsCertificateEntry(String a) { return false; }
public String engineGetCertificateAlias(Certificate c) { return null; }
public void engineStore(OutputStream stream, char[] password) { }
public void engineLoad(InputStream stream, char[] password) { }
}
public static class K2 extends K1 {
public boolean engineProbe(InputStream s) {
return true;
}
}
}

View file

@ -0,0 +1,167 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 8006591
* @summary Protect keystore entries using stronger PBE algorithms
*/
import java.io.*;
import java.security.*;
import javax.crypto.*;
import javax.crypto.spec.*;
// Retrieve a keystore entry, protected by the default encryption algorithm.
// Set the keystore entry, protected by a stronger encryption algorithm.
public class PBETest {
private final static String DIR = System.getProperty("test.src", ".");
private final static String KEY_PROTECTION_PROPERTY =
"keystore.PKCS12.keyProtectionAlgorithm";
private static final String[] PBE_ALGOS = {
"PBEWithSHA1AndDESede",
"PBEWithHmacSHA1AndAES_128",
"PBEWithHmacSHA224AndAES_128",
"PBEWithHmacSHA256AndAES_128",
"PBEWithHmacSHA384AndAES_128",
"PBEWithHmacSHA512AndAES_128"
};
private static final char[] PASSWORD = "passphrase".toCharArray();
private static final String KEYSTORE_TYPE = "JKS";
private static final String KEYSTORE = DIR + "/keystore.jks";
private static final String NEW_KEYSTORE_TYPE = "PKCS12";
private static final String ALIAS = "vajra";
private static final byte[] IV = {
0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,
0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,0x20
};
private static final byte[] SALT = {
0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08
};
private static final int ITERATION_COUNT = 1024;
public static void main(String[] args) throws Exception {
for (String algo : PBE_ALGOS) {
String filename = algo + ".p12";
main0(algo, filename, true);
main0(algo, filename, false);
Security.setProperty(KEY_PROTECTION_PROPERTY, algo);
main0(null, "PBE.p12", false);
Security.setProperty(KEY_PROTECTION_PROPERTY, "");
}
main0(null, "default.p12", false); // default algorithm
}
private static void main0(String algo, String filename, boolean useParams)
throws Exception {
KeyStore keystore = load(KEYSTORE_TYPE, KEYSTORE, PASSWORD);
KeyStore.Entry entry =
keystore.getEntry(ALIAS,
new KeyStore.PasswordProtection(PASSWORD));
System.out.println("Retrieved key entry named '" + ALIAS + "'");
Key originalKey = null;
if (entry instanceof KeyStore.PrivateKeyEntry) {
originalKey = ((KeyStore.PrivateKeyEntry) entry).getPrivateKey();
} else if (entry instanceof KeyStore.SecretKeyEntry) {
originalKey = ((KeyStore.SecretKeyEntry) entry).getSecretKey();
}
// Set entry
KeyStore keystore2 = load(NEW_KEYSTORE_TYPE, null, null);
if (useParams) {
keystore2.setEntry(ALIAS, entry,
new KeyStore.PasswordProtection(PASSWORD, algo,
new PBEParameterSpec(SALT, ITERATION_COUNT,
new IvParameterSpec(IV))));
System.out.println("Encrypted key entry using: " + algo +
" (with PBE parameters)");
} else if (algo != null) {
keystore2.setEntry(ALIAS, entry,
new KeyStore.PasswordProtection(PASSWORD, algo, null));
System.out.println("Encrypted key entry using: " + algo +
" (without PBE parameters)");
} else {
keystore2.setEntry(ALIAS, entry,
new KeyStore.PasswordProtection(PASSWORD));
String prop = Security.getProperty(KEY_PROTECTION_PROPERTY);
if (prop == null || prop.isEmpty()) {
System.out.println("Encrypted key entry using: " +
"default PKCS12 key protection algorithm");
} else {
System.out.println("Encrypted key entry using: " +
"keyProtectionAlgorithm=" + prop);
}
}
try (FileOutputStream outStream = new FileOutputStream(filename)) {
System.out.println("Storing keystore to: " + filename);
keystore2.store(outStream, PASSWORD);
}
try {
keystore2 = load(NEW_KEYSTORE_TYPE, filename, PASSWORD);
entry = keystore2.getEntry(ALIAS,
new KeyStore.PasswordProtection(PASSWORD));
Key key;
if (entry instanceof KeyStore.PrivateKeyEntry) {
key = ((KeyStore.PrivateKeyEntry) entry).getPrivateKey();
} else if (entry instanceof KeyStore.SecretKeyEntry) {
key = ((KeyStore.SecretKeyEntry) entry).getSecretKey();
} else {
throw new Exception("Failed to retrieve key entry");
}
if (originalKey.equals(key)) {
System.out.println("Retrieved key entry named '" + ALIAS + "'");
System.out.println();
} else {
throw new Exception(
"Failed: recovered key does not match the original key");
}
} finally {
new File(filename).delete();
}
}
private static KeyStore load(String type, String path, char[] password)
throws Exception {
KeyStore keystore = KeyStore.getInstance(type);
if (path != null) {
try (FileInputStream inStream = new FileInputStream(path)) {
System.out.println("Loading keystore from: " + path);
keystore.load(inStream, password);
System.out.println("Loaded keystore with " + keystore.size() +
" entries");
}
} else {
keystore.load(null, null);
}
return keystore;
}
}

View file

@ -0,0 +1,65 @@
/*
* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import java.security.KeyStore;
import java.security.Security;
import static java.lang.System.out;
/**
* @test
* @bug 8048830
* @summary Set up keystore.type secure property and check that
* KeyStore.getDefaultType() value is related to property value. Expect a full
* match the value 'keystore.type' and the value of the
* KeyStore.getDefaultType()
* @run main/othervm CheckDefaults
*/
public class CheckDefaults {
private static final String DEFAULT_KEY_STORE_TYPE = "pkcs12";
private static final String[] KEY_STORE_TYPES = {"jks", "pkcs12", "jceks",
"Unregistered_type_of_KS"};
private void runTest(String[] args) {
if (!KeyStore.getDefaultType().
equalsIgnoreCase(DEFAULT_KEY_STORE_TYPE)) {
throw new RuntimeException(String.format("Default keystore type "
+ "Expected '%s' . Actual: '%s' ", DEFAULT_KEY_STORE_TYPE,
KeyStore.getDefaultType()));
}
for (String ksDefaultType : KEY_STORE_TYPES) {
Security.setProperty("keystore.type", ksDefaultType);
if (!KeyStore.getDefaultType().equals(ksDefaultType)) {
throw new RuntimeException(String.format(
"Keystore default type value: '%s' cannot be set up via"
+ " keystore.type "
+ "security property, Actual: '%s'",
ksDefaultType, KeyStore.getDefaultType()));
}
}
out.println("Test Passed");
}
public static void main(String[] args) {
CheckDefaults checkDefaultsTest = new CheckDefaults();
checkDefaultsTest.runTest(args);
}
}

View file

@ -0,0 +1,44 @@
/*
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import java.security.KeyStore;
import static java.lang.System.out;
/**
* @test
* @bug 8304956
* @summary Set keystore.type as null and check that
* KeyStore.getDefaultType() returns pkcs12
* @run main/othervm
* -Djava.security.properties==${test.src}/java.security CheckDefaults
*/
public class CheckNullDefault {
public static void main(String[] args) {
if (!KeyStore.getDefaultType().
equalsIgnoreCase("pkcs12")) {
throw new RuntimeException(String.format("Default keystore type "
+ "Expected '%s' . Actual: '%s' ", "pkcs12",
KeyStore.getDefaultType()));
}
out.println("Test Passed");
}
}

View file

@ -0,0 +1,234 @@
/*
* Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import static java.lang.System.out;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.Key;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.UnrecoverableKeyException;
import java.security.cert.Certificate;
import java.util.Arrays;
import java.util.Base64;
import java.util.Enumeration;
/*
* @test
* @bug 8048619
* @author Bill Situ
* @summary Test converting keystore from jceks to P12 and from P12 to other
* (jceks,jks). including following test cases:
* Read jceks key store and convert to the p12 key store, then compare entries
* in the two key stores.
* Read p12 key store and convert to the jceks key store, then compare entries
* in the two key stores.
* Read p12 key store (contains only private key and a self-signed certificate)
* and convert to the jceks key store, then compare entries of two key stores.
* Read p12 key store (contains 2 entries) and convert to the jceks key store,
* then compare entries in the two key stores.
* Read p12 key store (entry password and key store password are different) and
* convert to the jceks key store, then compare entries in the two key stores.
* Read p12 key store and convert to the jks key store, then compare entries
* in the two key stores.
* Read p12 key store (contains only private key and a self-signed certificate)
* and convert to the jks key store, then compare entries in the two key stores.
* Read p12 key store (contains 2 entries) and convert to the jks key store,
* then compare entries in the two key stores.
* Read p12 key store (entry password and key store password are different) and
* convert to the jks key store, then compare entries in the two key stores.
*/
public class ConvertP12Test {
private static final String SUN_JSSE = "SunJSSE";
private static final String SUN_JCE = "SunJCE";
private static final String SUN = "SUN";
private static final String PKCS12 = "pkcs12";
private static final String JCE_KS = "JceKS";
private static final String JKS = "JKS";
public static void main(String args[]) throws Exception {
ConvertP12Test jstest = new ConvertP12Test();
jstest.driver("JceksToP12", "keystoreCA.jceks.data", JCE_KS, SUN_JCE,
"storepass", "keypass", PKCS12, SUN_JSSE);
jstest.driver("P12ToJceks_Chain", "ie_jceks_chain.pfx.data", PKCS12,
SUN_JSSE, "pass", "pass", JCE_KS, SUN_JCE);
jstest.driver("P12ToJceks_SelfSigned", "jdk_jceks_selfsigned.p12.data",
PKCS12, SUN_JSSE, "pass", "pass", JCE_KS, SUN_JCE);
jstest.driver("P12ToJceks_TwoEntry", "jdk_jceks_twoentry.p12.data",
PKCS12, SUN_JSSE, "pass", "pass", JCE_KS, SUN_JCE);
jstest.driver("P12ToJceks_TwoPass", "jdk_jceks_twopass.p12.data",
PKCS12, SUN_JSSE, "storepass", "keypass", JCE_KS, SUN_JCE);
jstest.driver("P12ToJks_Chain", "ie_jks_chain.pfx.data", PKCS12,
SUN_JSSE, "pass", "pass", JKS, SUN);
jstest.driver("P12ToJks_SelfSigned", "jdk_jks_selfsigned.p12.data",
PKCS12, SUN_JSSE, "pass", "pass", JKS, SUN);
jstest.driver("P12ToJks_TwoEntry", "jdk_jks_twoentry.p12.data", PKCS12,
SUN_JSSE, "pass", "pass", JKS, SUN);
jstest.driver("P12ToJks_TwoPass", "jdk_jks_twopass.p12.data", PKCS12,
SUN_JSSE, "storepass", "keypass", JKS, SUN);
}
private void driver(String testCase, String inKeyStore,
String inKeyStoreType, String inKeyStoreTypePrv,
String inStorePass, String inKeyPass, String outKeyStoreType,
String outKeyStorePrv) throws Exception {
String outStorePass = "pass";
String outKeyPass = "pass";
KeyStore inputKeyStore, outputKeyStore;
out.println("Testing " + testCase);
String keystorePath = System.getProperty("test.src", ".")
+ File.separator + "certs" + File.separator + "convertP12";
out.println("Output KeyStore : " + inKeyStore + ".out");
String outKeyStoreName = inKeyStore + ".out";
try (FileOutputStream fout = new FileOutputStream(outKeyStoreName);) {
inputKeyStore = KeyStore.getInstance(inKeyStoreType,
inKeyStoreTypePrv);
// KeyStore have encoded by Base64.getMimeEncoder().encode(),need
// decode first.
byte[] input = Files.readAllBytes(Paths.get(keystorePath,
inKeyStore));
ByteArrayInputStream arrayIn = new ByteArrayInputStream(Base64
.getMimeDecoder().decode(input));
out.println("Input KeyStore : " + inKeyStore);
inputKeyStore.load(arrayIn, inStorePass.toCharArray());
outputKeyStore = KeyStore.getInstance(outKeyStoreType,
outKeyStorePrv);
outputKeyStore.load(null, null);
run(inputKeyStore, outputKeyStore, inKeyPass, outKeyPass);
outputKeyStore.store(fout, outStorePass.toCharArray());
// for P12ToJks_TwoEntry test case will test includes each other,
// others just test compareKeystore
if (testCase.contains("TwoEntry")) {
compareKeyStore(inputKeyStore, outputKeyStore, inKeyPass,
outKeyPass, 2);
compareKeyStore(outputKeyStore, inputKeyStore, outKeyPass,
inKeyPass, 2);
} else {
compareKeyStore(inputKeyStore, outputKeyStore, inKeyPass,
outKeyPass, 1);
}
out.println("Test " + testCase + " STATUS: Pass!!");
} catch (Exception ex) {
out.println("Test " + testCase + " STATUS: failed with exception: "
+ ex.getMessage());
throw ex;
}
}
private void run(KeyStore inputKeyStore, KeyStore outputKeyStore,
String inKeyPass, String outKeyPass) throws Exception {
Enumeration<String> e = inputKeyStore.aliases();
String alias;
while (e.hasMoreElements()) {
alias = e.nextElement();
Certificate[] certs = inputKeyStore.getCertificateChain(alias);
boolean isCertEntry = inputKeyStore.isCertificateEntry(alias);
// Test KeyStore only contain key pair entries.
if (isCertEntry == true) {
throw new RuntimeException(
"inputKeystore should not be certEntry because test"
+ " keystore only contain key pair entries"
+ " for alias:" + alias);
}
boolean isKeyEntry = inputKeyStore.isKeyEntry(alias);
Key key = null;
if (isKeyEntry) {
key = inputKeyStore.getKey(alias, inKeyPass.toCharArray());
} else {
throw new RuntimeException("Entry type unknown for alias:"
+ alias);
}
outputKeyStore.setKeyEntry(alias, key, outKeyPass.toCharArray(),
certs);
}
}
private void compareKeyStore(KeyStore a, KeyStore b, String inKeyPass,
String outKeyPass, int keyStoreSize) throws Exception {
if (a.size() != keyStoreSize || b.size() != keyStoreSize) {
throw new RuntimeException("size not match or size not equal to "
+ keyStoreSize);
}
Enumeration<String> eA = a.aliases();
while (eA.hasMoreElements()) {
String aliasA = eA.nextElement();
if (!b.containsAlias(aliasA)) {
throw new RuntimeException("alias not match for alias:"
+ aliasA);
}
compareKeyEntry(a, b, inKeyPass, outKeyPass, aliasA);
}
}
private void compareKeyEntry(KeyStore a, KeyStore b, String aPass,
String bPass, String alias) throws KeyStoreException,
UnrecoverableKeyException, NoSuchAlgorithmException {
Certificate[] certsA = a.getCertificateChain(alias);
Certificate[] certsB = b.getCertificateChain(alias);
if (!Arrays.equals(certsA, certsB)) {
throw new RuntimeException("Certs don't match for alias:" + alias);
}
Key keyA = a.getKey(alias, aPass.toCharArray());
Key keyB = b.getKey(alias, bPass.toCharArray());
if (!keyA.equals(keyB)) {
throw new RuntimeException(
"Key don't match for alias:" + alias);
}
}
}

View file

@ -0,0 +1,152 @@
/*
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import java.io.File;
import static java.lang.System.err;
import java.security.*;
import java.security.cert.Certificate;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import javax.crypto.spec.PBEParameterSpec;
import jdk.test.lib.RandomFactory;
import static java.lang.System.out;
import java.util.Arrays;
/**
* @test
* @bug 8048830
* @summary Test for feature 'support stronger entry protection'. An entry is
* stored to keystore with different PasswordProtection objects which are
* specified by different PBE algorithms (use -Dseed=X to set PRNG seed)
* @library /test/lib ../
* @key randomness
* @build jdk.test.lib.RandomFactory
* @run main EntryProtectionTest
*/
public class EntryProtectionTest {
private static final char[] PASSWORD = "passwd".toCharArray();
private static final String ALIAS = "testkey";
private static final byte[] SALT = new byte[8];
private static final int ITERATION_COUNT = 1024;
private static final List<KeyStore.PasswordProtection> PASSWORD_PROTECTION
= new ArrayList<>();
private static final String KEYSTORE_PATH = System.getProperty(
"test.classes" + File.separator + "ks.pkcs12",
"." + File.separator + "ks.pkcs12");
private void runTest() throws Exception {
KeyStore ksIn = Utils.loadKeyStore(KEYSTORE_PATH,
Utils.KeyStoreType.pkcs12, PASSWORD);
KeyStore ksTest = KeyStore
.getInstance(Utils.KeyStoreType.pkcs12.name());
ksTest.load(null);
Certificate cert = ksIn.getCertificate(ALIAS);
Key key = ksIn.getKey(ALIAS, PASSWORD);
KeyStore.Entry keyStoreEntry = new KeyStore.PrivateKeyEntry(
(PrivateKey) key, new Certificate[]{cert});
for (KeyStore.PasswordProtection passwordAlgorithm :
PASSWORD_PROTECTION) {
out.println("Try to use: " +
passwordAlgorithm.getProtectionAlgorithm());
ksTest.setEntry(ALIAS, keyStoreEntry, passwordAlgorithm);
KeyStore.Entry entryRead = ksTest.getEntry(ALIAS,
new KeyStore.PasswordProtection(PASSWORD));
if (!isPrivateKeyEntriesEqual((KeyStore.PrivateKeyEntry)
keyStoreEntry, (KeyStore.PrivateKeyEntry)entryRead)) {
err.println("Original entry in KeyStore: " + keyStoreEntry);
err.println("Enc/Dec entry : " + entryRead);
throw new RuntimeException(
String.format(
"Decrypted & original enities do "
+ "not match. Algo: %s, Actual: %s, "
+ "Expected: %s",
passwordAlgorithm.getProtectionAlgorithm(),
entryRead, keyStoreEntry));
}
ksTest.deleteEntry(ALIAS);
}
out.println("Test Passed");
}
public static void main(String args[]) throws Exception {
EntryProtectionTest entryProtectionTest = new EntryProtectionTest();
entryProtectionTest.setUp();
entryProtectionTest.runTest();
}
private void setUp() {
out.println("Using KEYSTORE_PATH:"+KEYSTORE_PATH);
Utils.createKeyStore(Utils.KeyStoreType.pkcs12, KEYSTORE_PATH, ALIAS);
Random rand = RandomFactory.getRandom();
rand.nextBytes(SALT);
out.print("Salt: ");
for (byte b : SALT) {
out.format("%02X ", b);
}
out.println("");
PASSWORD_PROTECTION
.add(new KeyStore.PasswordProtection(PASSWORD,
"PBEWithMD5AndDES", new PBEParameterSpec(SALT,
ITERATION_COUNT)));
PASSWORD_PROTECTION.add(new KeyStore.PasswordProtection(PASSWORD,
"PBEWithSHA1AndDESede", null));
PASSWORD_PROTECTION.add(new KeyStore.PasswordProtection(PASSWORD,
"PBEWithSHA1AndRC2_40", null));
PASSWORD_PROTECTION.add(new KeyStore.PasswordProtection(PASSWORD,
"PBEWithSHA1AndRC2_128", null));
PASSWORD_PROTECTION.add(new KeyStore.PasswordProtection(PASSWORD,
"PBEWithSHA1AndRC4_40", null));
PASSWORD_PROTECTION.add(new KeyStore.PasswordProtection(PASSWORD,
"PBEWithSHA1AndRC4_128", null));
}
/**
* Checks whether given two KeyStore.PrivateKeyEntry parameters are equal
* The KeyStore.PrivateKeyEntry fields like {privateKey, certificateChain[]}
* are checked for equality and another field Set<attributes> is not checked
* as default implementation adds few PKCS12 attributes during read
* operation
* @param first
* parameter is of type KeyStore.PrivateKeyEntry
* @param second
* parameter is of type KeyStore.PrivateKeyEntry
* @return boolean
* true when both the KeyStore.PrivateKeyEntry fields are equal
*/
boolean isPrivateKeyEntriesEqual(KeyStore.PrivateKeyEntry first,
KeyStore.PrivateKeyEntry second) {
//compare privateKey
if (!Arrays.equals(first.getPrivateKey().getEncoded(),
second.getPrivateKey().getEncoded())) {
err.println("Mismatch found in privateKey!");
return false;
}
//compare certificateChain[]
if (!Arrays.equals(first.getCertificateChain(),
second.getCertificateChain())) {
err.println("Mismatch found in certificate chain!");
return false;
}
return true;
}
}

View file

@ -0,0 +1,157 @@
/*
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.StandardOpenOption;
import java.util.Base64;
import jdk.test.lib.process.OutputAnalyzer;
import static java.lang.System.out;
import java.nio.file.Paths;
import java.util.List;
/**
* @test
* @bug 8048830
* @summary Test for PKCS12 keystore list , export commands. Refer README for
* keystore files information
* @library ../
* @library /test/lib
* @run main KeytoolReaderP12Test
*/
public class KeytoolReaderP12Test {
private static final String WORKING_DIRECTORY = System.getProperty(
"test.classes", "."+ File.separator);
//private static final String KS_PASSWD = "pass";
private static final String KS_PASSWD = "storepass";
private static final String CERT_CHAIN_PASSWD = "password";
private static final String SOURCE_DIRECTORY =
System.getProperty("test.src", "." + File.separator);
public static void main(String[] args) throws Exception {
List<String> expectedValues = null;
out.println("Self signed test");
expectedValues = Files.readAllLines(Paths.get(SOURCE_DIRECTORY,
"api_private_key.p12_expected.data"));
readTest("api_private_key.p12.data", KS_PASSWD, expectedValues);
out.println("Self signed test Passed");
out.println("private key with selfsigned cert, key pair not match");
expectedValues = Files.readAllLines(Paths.get(SOURCE_DIRECTORY,
"api_private_key_not_match.p12_expected.data"));
readTest("api_private_key_not_match.p12.data", KS_PASSWD,
expectedValues);
out.println("private key with selfsigned cert, key pair "
+ "not match passed");
out.println("cert chain test");
expectedValues = Files.readAllLines(Paths.get(SOURCE_DIRECTORY,
"api_cert_chain.p12_expected.data"));
readTest("api_cert_chain.p12.data", CERT_CHAIN_PASSWD, expectedValues);
out.println("cert chain test passed");
out.println("IE self test");
expectedValues = Files.readAllLines(Paths.get(SOURCE_DIRECTORY,
"ie_self.pfx.pem"));
exportTest("ie_self.pfx.data", "pkcs12testenduser1",
KS_PASSWD, expectedValues);
out.println("IE self test passed");
out.println("IE chain test");
expectedValues = Files.readAllLines(Paths.get(SOURCE_DIRECTORY,
"ie_chain.pfx.pem"));
exportTest("ie_chain.pfx.data", "servercert",
CERT_CHAIN_PASSWD, expectedValues);
out.println("IE chain test passed");
out.println("Netscape self");
expectedValues = Files.readAllLines(Paths.get(SOURCE_DIRECTORY,
"netscape_self.p12.pem"));
exportTest("netscape_self.p12.data", "pkcs12testenduser1",
KS_PASSWD, expectedValues);
out.println("Netscape self passed");
out.println("Mozilla self test");
expectedValues = Files.readAllLines(Paths.get(SOURCE_DIRECTORY,
"mozilla_self.p12.pem"));
exportTest("mozilla_self.p12.data", "pkcs12testenduser1",
KS_PASSWD, expectedValues);
out.println("Mozilla self test passed");
out.println("Openssl test");
expectedValues = Files.readAllLines(Paths.get(SOURCE_DIRECTORY,
"openssl.p12.pem"));
exportTest("openssl.p12.data", "servercert", CERT_CHAIN_PASSWD, expectedValues);
out.println("openssl test passed");
out.println("with different keystore and entrykey password");
expectedValues = Files.readAllLines(Paths.get(SOURCE_DIRECTORY,
"api_two_pass.p12_expected.data"));
readTest("api_two_pass.p12.data", KS_PASSWD,
expectedValues);
out.println("two pass test passed");
}
private static void readTest(String name, String password,
List<String> expectedValues)
throws IOException {
convertToPFX(name);
final String[] command = new String[]{"-debug", "-list", "-v",
"-keystore", WORKING_DIRECTORY + File.separator + name,
"-storetype", "pkcs12", "-storepass", password};
runAndValidate(command, expectedValues);
}
private static void exportTest(String name, String alias,
String password, List<String> expectedValues)
throws IOException {
convertToPFX(name);
final String[] command = new String[]{"-debug", "-export", "-alias",
alias, "-keystore", WORKING_DIRECTORY + File.separator + name,
"-storepass", password, "-storetype", "pkcs12", "-rfc"};
runAndValidate(command, expectedValues);
}
private static void runAndValidate(String[] command,
List<String> expectedValues) throws IOException {
OutputAnalyzer output = Utils.executeKeytoolCommand(command);
if (expectedValues != null) {
expectedValues.stream().forEach(line -> {
output.shouldContain(line);
});
}
}
/**
* Decodes the base64 encoded keystore and writes into new file
* @param name base64 encoded keystore name
*/
private static void convertToPFX(String name) throws IOException{
File base64File = new File(SOURCE_DIRECTORY, name);
File pkcs12File = new File(WORKING_DIRECTORY, name);
byte[] input = Files.readAllBytes(base64File.toPath());
Files.write(pkcs12File.toPath(), Base64.getMimeDecoder().
decode(input), StandardOpenOption.CREATE);
}
}

View file

@ -0,0 +1,127 @@
/*
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import java.io.File;
import jdk.test.lib.process.OutputAnalyzer;
import static java.lang.System.out;
/**
* @test
* @bug 8048830
* @summary Tests for creating pkcs12 keystore with various algorithms
* @library ../
* @library /test/lib
* @run main KeytoolWriteP12Test
*/
public class KeytoolWriteP12Test {
private static final String ALIAS = "pkcs12testCA";
private static final Utils.KeyStoreType PKCS12 = Utils.KeyStoreType.pkcs12;
private static final int FAILED_EXIT_CODE = 1;
private static final String CERT_FILE_NAME = "cert.data";
private static final String DNAME = "CN=PKCS12 Test CA, OU=Security SQE, "
+ "O=JavaSoft, C=US";
private static final String WORKING_DIRECTORY = System.
getProperty("test.classes", "." + File.separator);
private enum Algorithm {
DSA, RSA, ECC
};
private void run() {
out.println("Running DSA Test");
keytoolListTest("kt_DSA.p12", Algorithm.DSA);
out.println("DSA Test passed");
out.println("Running RSA Test");
final String rsaKeyStoreName = "kt_RSA_MD5.p12";
keytoolListTest(rsaKeyStoreName, Algorithm.RSA);
out.println("RSA Test passed");
out.println("Running RSA and Signing Algorithm SHA1withRSA Test");
keytoolListTest("kt_RSA_SHA1.p12", Algorithm.RSA,
"-sigalg", "SHA1withRSA");
out.println("RSA and Signing Algorithm SHA1withRSA Test Passed");
out.println("Running Keysize 256 Test");
keytoolListNegativeTest("kt_DSA_256.p12", Algorithm.DSA, "-keysize",
"256");
out.println("Keysize 256 Test Passed");
out.println("Running Keysize 1023 Test");
keytoolListTest("kt_RSA_MD5_1023.p12", Algorithm.RSA, "-keysize",
"1023");
out.println("Keysize 1023 Test Passed");
out.println("Running Export certificate Test");
exportTest(rsaKeyStoreName);
out.println("Export certificate Test Passed");
}
private void exportTest(String keyStore) {
final String keyStoreName = WORKING_DIRECTORY + File.separator
+ keyStore;
deleteKeyStoreFile(keyStoreName);
Utils.createKeyStore(DNAME, PKCS12, keyStore, ALIAS,
Algorithm.RSA.name());
final String certFilePath = WORKING_DIRECTORY + File.separator
+ CERT_FILE_NAME;
Utils.exportCert(PKCS12, keyStore,
ALIAS, certFilePath);
final String[] command = new String[]{"-debug", "-printcert", "-v",
"-file", certFilePath};
Utils.executeKeytoolCommand(command);
}
private void keytoolListTest(String keyStore, Algorithm algorithm,
String ...optionalArgs) {
final String keyStoreName = WORKING_DIRECTORY + File.separator
+ keyStore;
final String[] command = new String[]{"-debug", "-list", "-v", "-alias",
ALIAS, "-keystore", keyStoreName, "-storetype", "pkcs12",
"-storepass", Utils.DEFAULT_PASSWD};
deleteKeyStoreFile(keyStoreName);
Utils.createKeyStore(DNAME, PKCS12, keyStoreName, ALIAS,
algorithm.name(), optionalArgs);
OutputAnalyzer output = Utils.executeKeytoolCommand(command);
output.shouldContain(DNAME);
}
private void keytoolListNegativeTest(String keyStore, Algorithm algorithm,
String... optionalArgs) {
final String keyStoreName = WORKING_DIRECTORY + File.separator
+ keyStore;
deleteKeyStoreFile(keyStoreName);
Utils.createKeyStore(DNAME, PKCS12, keyStoreName, ALIAS,
algorithm.name(), optionalArgs, FAILED_EXIT_CODE);
}
public static void main(String[] args) {
KeytoolWriteP12Test test = new KeytoolWriteP12Test();
test.run();
out.println("Test Passed");
}
private void deleteKeyStoreFile(String fileName) {
File file = new File(fileName);
if (file.exists()) {
file.delete();
}
}
}

View file

@ -0,0 +1,78 @@
/*
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import java.io.File;
import java.security.Key;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.UnrecoverableKeyException;
import java.security.cert.Certificate;
import java.io.IOException;
import java.security.cert.CertificateException;
import static java.lang.System.out;
/**
* @test
* @bug 8048830
* @summary Entry's attribute set should be empty
* @library ../
* @library /test/lib
* @run main MetadataEmptyTest
*/
public class MetadataEmptyTest {
private static final char[] PASSWORD = "passwd".toCharArray();
private static final String ALIAS = "testkey";
private static final String KEYSTORE_PATH = System.getProperty(
"test.classes" + File.separator + "ks.pkcs12",
"." + File.separator + "ks.pkcs12");
private void runTest() throws IOException, KeyStoreException,
NoSuchAlgorithmException, CertificateException,
UnrecoverableKeyException {
KeyStore ks = Utils.loadKeyStore(KEYSTORE_PATH,
Utils.KeyStoreType.pkcs12, PASSWORD);
Key key = ks.getKey(ALIAS, PASSWORD);
Certificate cert = ks
.getCertificate(ALIAS);
KeyStore.Entry entry = new KeyStore.PrivateKeyEntry(
(PrivateKey) key,
new Certificate[]{cert});
if (!entry.getAttributes().isEmpty()) {
throw new RuntimeException("Entry's attributes set "
+ "must be empty");
}
out.println("Test Passed");
}
public static void main(String[] args) throws Exception{
MetadataEmptyTest test = new MetadataEmptyTest();
test.setUp();
test.runTest();
}
private void setUp() {
Utils.createKeyStore(Utils.KeyStoreType.pkcs12, KEYSTORE_PATH, ALIAS);
}
}

View file

@ -0,0 +1,147 @@
/*
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import java.io.File;
import java.io.IOException;
import java.security.GeneralSecurityException;
import java.security.Key;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.PKCS12Attribute;
import java.security.PrivateKey;
import java.security.UnrecoverableEntryException;
import java.security.cert.Certificate;
import java.util.Arrays;
import java.util.Set;
import static java.lang.System.out;
import java.util.HashSet;
/**
* @test
* @bug 8048830
* @summary Test store metadata attributes to PKCS12 keystore.
* @library ../
* @library /test/lib
* @run main MetadataStoreLoadTest
*/
public class MetadataStoreLoadTest {
private static final char[] PASSWORD = "passwd".toCharArray();
private static final char[] KEY_PASSWORD = "keypasswd".toCharArray();
private static final String ALIAS = "testkey_metadata";
private static final String KEYSTORE = "ks.pkcs12";
private static final String KESTORE_NEW = "ks-attr.pkcs12";
private static final int MAX_HUGE_SIZE = 2000000;
private static final String WORKING_DIRECTORY = System.getProperty(
"test.classes", "." + File.separator);
private static final String KEYSTORE_PATH = WORKING_DIRECTORY
+ File.separator + KEYSTORE;
private static KeyStore.Entry.Attribute[] ATTR_SET;
private void runTest() throws GeneralSecurityException,
UnrecoverableEntryException, NoSuchAlgorithmException,
KeyStoreException, IOException {
storeAttrs();
checkAttrs();
}
private void storeAttrs() throws UnrecoverableEntryException,
GeneralSecurityException, NoSuchAlgorithmException,
KeyStoreException, IOException {
KeyStore ksIn = Utils.loadKeyStore(KEYSTORE_PATH,
Utils.KeyStoreType.pkcs12, PASSWORD);
KeyStore ksAttr = KeyStore
.getInstance(Utils.KeyStoreType.pkcs12.name());
ksAttr.load(null);
Key key = ksIn.getKey(ALIAS, PASSWORD);
Certificate cert = ksIn.getCertificate(ALIAS);
Set<KeyStore.Entry.Attribute> attrs =
new HashSet<>(Arrays.asList(ATTR_SET));
KeyStore.Entry e = new KeyStore.PrivateKeyEntry((PrivateKey) key,
new Certificate[]{cert}, attrs);
ksAttr.setEntry(ALIAS, e, new KeyStore.PasswordProtection(
KEY_PASSWORD));
out.println("Attributes before store:");
e.getAttributes().stream().forEach((attr) -> {
out.println(attr.getName() + ", '" + attr.getValue() + "'");
});
Utils.saveKeyStore(ksAttr, WORKING_DIRECTORY + File.separator
+ KESTORE_NEW, PASSWORD);
}
private void checkAttrs() throws UnrecoverableEntryException,
GeneralSecurityException, NoSuchAlgorithmException,
KeyStoreException, IOException {
KeyStore ks = Utils.loadKeyStore(WORKING_DIRECTORY
+ File.separator
+ KESTORE_NEW, Utils.KeyStoreType.pkcs12, PASSWORD);
KeyStore.Entry keyStoreEntry = ks.getEntry(ALIAS,
new KeyStore.PasswordProtection(KEY_PASSWORD));
out.println("Attributes after store:");
//print attribute values
keyStoreEntry.getAttributes().stream().forEach((attr) -> {
out.println(attr.getName() + ", '" + attr.getValue() + "'");
});
Arrays.stream(ATTR_SET).forEach((attr) -> {
if (!keyStoreEntry.getAttributes().contains(attr)) {
throw new RuntimeException("Entry doesn't contain attribute: ("
+ attr.getName() + ", '" + attr.getValue() + "')");
}
});
}
public static void main(String[] args) throws Exception {
MetadataStoreLoadTest test = new MetadataStoreLoadTest();
test.setUp();
test.runTest();
out.println("Test Passed");
}
private void setUp() {
Utils.createKeyStore(Utils.KeyStoreType.pkcs12, KEYSTORE_PATH, ALIAS);
final String allCharsString = "`1234567890-=qwertyuiop[]asdfghjkl;'\\zx"
+ "cvbnm,./!@#$%^&*()_+QWERTYUIOP{}ASDFGHJKL:|>ZXCVBNM<>?\"";
StringBuilder sbPrintable = new StringBuilder();
while (sbPrintable.length() < MAX_HUGE_SIZE) {
sbPrintable.append(allCharsString);
}
final String hugePrintable = sbPrintable.toString();
final String binaryString = "00:11:22:33:44:55:66:77:88:99:AA:BB:DD:"
+ "EE:FF:";
StringBuilder sbBinary = new StringBuilder();
sbBinary.append(binaryString);
while (sbBinary.length() < MAX_HUGE_SIZE) {
sbBinary.append(":").append(binaryString);
}
sbBinary.insert(0, "[").append("]");
final String hugeBinary = sbBinary.toString();
ATTR_SET = new PKCS12Attribute[5];
ATTR_SET[0] = new PKCS12Attribute("1.2.840.113549.1.9.1",
"Test email addres attr <test@oracle.com>");
ATTR_SET[1] = new PKCS12Attribute("1.2.110.1", "not registered attr");
ATTR_SET[2] = new PKCS12Attribute("1.2.110.2", hugePrintable);
ATTR_SET[3] = new PKCS12Attribute("1.2.110.3", hugeBinary);
ATTR_SET[4] = new PKCS12Attribute("1.2.110.2", " ");
}
}

View file

@ -0,0 +1,28 @@
The test KeytoolReaderP12Test.java depends on keystore data files and validates
with output generated by keystore list/export commands
KeyStore File storetype aliasname keyalg SignatureAlgorithm
------ ------ ------ ------ ---
api_private_key.p12.data pkcs12 pkcs12testenduser1 RSA 1024 MD5withRSA
api_private_key_not_match.p12.data pkcs12 pkcs12testca RSA 2048 SHA1withRSA
api_cert_chain.p12.data pkcs12 pkcs12testenduser1 RSA 1024 MD5withRSA
api_two_pass.p12.data pkcs12 pkcs12testca RSA 2048 SHA1withRSA
netscape_self.p12.data pkcs12 pkcs12testenduser1 RSA 1023 MD5withRSA
mozilla_self.p12.data pkcs12 pkcs12testenduser1 RSA 1023 MD5withRSA
ie_self.pfx.data pkcs12 a3aa3db3-3ec2-4d8b-8cf1-4d3c54afe386 RSA 1023 MD5withRSA
ie_chain.pfx.data pkcs12 4e3053da-ff8e-46d2-b6d1-c38e431dea1f RSA 1023 MD5withRSA
Following keystore commands were used
1. Generate keystore and along with keypair
<JAVA-HOME>/bin/keytool -genkey -v -alias pkcs12test -keyalg "RSA" -keysize 2048
-sigalg "SHA1withRSA" -dname "cn=PKCS12 Test CA, ou=Security SQE, o=JavaSoft,
c=US" -validity 7300 -keypass storepass -keystore ks-pkcs.data -storepass
storepass -storetype pkcs12
2. Export certificate
<JAVA-HOME>/bin/keytool -export -alias pkcs12test -keystore ks-pkcs.data
-storetype pkcs12 -storepass storepass -file pkcs12testCA.cer.data
3. Import certificate
<JAVA-HOME>/bin/keytool -import -alias pkcs12test -keystore ks-pkcs.data
-storepass storepass -file pkcs12testCA.cer.data

View file

@ -0,0 +1,191 @@
/*
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import static java.lang.System.out;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.Key;
import java.security.KeyStore;
import java.security.cert.Certificate;
import java.security.cert.X509Certificate;
import java.util.Base64;
import java.util.Enumeration;
/*
* @test
* @bug 8048617
* @author Bill Situ
* @summary Read different types p12 key store to Check the read related APIs.
* including following test cases:
* ReadP12_IE_Chain: Read p12 key store (contains private key and associated
* certificate chain) from IE.
* ReadP12_IE_Self: Read p12 key store (contains only private key and
* self-signed certificate) from IE.
* ReadP12_JDK_Chain: Read p12 key store (contains private key and associated
* certificate chain) from JDK
* ReadP12_JDK_Self: Read p12 key store (contains only private key and
* self-signed certificate) from JDK.
* ReadP12_Mozilla_Self: Read p12 key store (contains only private key and
* self-signed certificate) from Mozilla.
* ReadP12_Mozilla_Chain: Read p12 key store (contains private key and
* associated certificate chain) from Mozilla.
* ReadP12_Mozilla_TwoEntries: Read p12 key store (contains 2 entries) from
* Mozilla.
* ReadP12_Netscape_Chain: Read p12 key store (contains private key and
* associated certificate chain) from Netscape.
* ReadP12_Netscape_Self: Read p12 key store (contains only private key and
* self-signed certificate) from Netscape.
* ReadP12_Netscape_TwoEntries: Read p12 key store (contains 2 entries) from
* Netscape.
* ReadP12_OpenSSL: Read p12 key store from OpenSSL.
*/
public class ReadP12Test {
private final static String IN_KEYSTORE_TYPE = "pkcs12";
private final static String IN_STORE_PASS = "pass";
public static void main(String args[]) throws Exception {
ReadP12Test jstest = new ReadP12Test();
String testCase = "";
try {
testCase = "ReadP12_IE_Chain";
jstest.readTest("ie_chain.pfx.data");
testCase = "ReadP12_IE_Self";
jstest.readTest("ie_self.pfx.data");
testCase = "ReadP12_JDK_Chain";
jstest.readTest("jdk_chain.p12.data");
testCase = "ReadP12_JDK_Self";
jstest.readTest("jdk_self.p12.data");
testCase = "ReadP12_Mozilla_Chain";
jstest.readTest("mozilla_chain.p12.data");
testCase = "ReadP12_Mozilla_Self";
jstest.readTest("mozilla_self.p12.data");
testCase = "ReadP12_Mozilla_TwoEntries";
jstest.readTest("mozilla_twoentries.p12.data");
testCase = "ReadP12_Netscape_Chain";
jstest.readTest("netscape_chain.p12.data");
testCase = "ReadP12_Netscape_Self";
jstest.readTest("netscape_self.p12.data");
testCase = "ReadP12_Netscape_TwoEntries";
jstest.readTest("netscape_twoentries.p12.data");
testCase = "ReadP12_openssl";
jstest.readTest("openssl.p12.data");
} catch (Exception e) {
System.err.println(testCase + ": failed with execption: "
+ e.getMessage());
throw e;
}
out.println(testCase + ": Pass!!");
}
private void readTest(String inKeyStore) throws Exception {
KeyStore inputKeyStore;
// Initialize KeyStore
String dir = System.getProperty("test.src", ".");
String keystorePath = dir + File.separator + "certs" + File.separator
+ "readP12";
inputKeyStore = KeyStore.getInstance(IN_KEYSTORE_TYPE);
// KeyStore have encoded by Base64.getMimeEncoder().encode(),need decode
// first.
byte[] input = Files.readAllBytes(Paths.get(keystorePath, inKeyStore));
ByteArrayInputStream arrayIn = new ByteArrayInputStream(Base64
.getMimeDecoder().decode(input));
inputKeyStore.load(arrayIn, IN_STORE_PASS.toCharArray());
out.println("Initialize KeyStore : " + inKeyStore + " success");
out.println("getProvider : " + inputKeyStore.getProvider());
out.println("getType : " + inputKeyStore.getType());
out.println("getDefaultType : " + KeyStore.getDefaultType());
int idx = 0;
Enumeration<String> e = inputKeyStore.aliases();
String alias;
while (e.hasMoreElements()) {
alias = e.nextElement();
out.println("Alias " + idx + " : " + alias);
if (inputKeyStore.containsAlias(alias) == false) {
throw new RuntimeException("Alias not found");
}
out.println("getCreationDate : "
+ inputKeyStore.getCreationDate(alias));
X509Certificate cert = (X509Certificate) inputKeyStore
.getCertificate(alias);
out.println("getCertificate : " + cert.getSubjectDN());
String retAlias = inputKeyStore.getCertificateAlias(cert);
if (!retAlias.equals(alias)) {
throw new RuntimeException("Alias mismatch");
}
out.println("getCertificateAlias : " + retAlias);
Certificate[] certs = inputKeyStore.getCertificateChain(alias);
for (int i = 0; i < certs.length; i++) {
out.println("getCertificateChain " + i + " : "
+ ((X509Certificate) certs[i]).getSubjectDN());
}
boolean isCertEntry = inputKeyStore.isCertificateEntry(alias);
// test KeyStore only contain key pair entries.
if (isCertEntry == true) {
throw new RuntimeException(
"inputKeystore should not be certEntry because test keystore only contain key pair entries.");
}
boolean isKeyEntry = inputKeyStore.isKeyEntry(alias);
if (isKeyEntry) {
Key key = inputKeyStore.getKey(alias,
IN_STORE_PASS.toCharArray());
out.println("Key : " + key.toString());
} else {
throw new RuntimeException("Entry type unknown\n");
}
idx++;
}
int size = inputKeyStore.size();
if (idx != size) {
throw new RuntimeException("Size not match");
}
}
}

View file

@ -0,0 +1,96 @@
/*
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.cert.Certificate;
import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import static java.lang.System.err;
import static java.lang.System.out;
/**
* @test
* @bug 8048830
* @summary Test imports certificate from file to PKCS12 keystore store it as
* trusted certificate Check import errors (must be not errors) & check keystore
* content after import
* @library ../
* @library /test/lib
* @run main StoreTrustedCertAPITest
*/
public class StoreTrustedCertAPITest {
private static final char[] PASSWORD = "passwd".toCharArray();
private static final String ALIAS = "testkey_stcapi";
private static final String WORKING_DIRECTORY = System.getProperty(
"test.classes", "." + File.separator);
private static final String CERT_PATH = WORKING_DIRECTORY + File.separator
+ "cert.data";
private static final String KEYSTORE_PATH = WORKING_DIRECTORY
+ File.separator + "ks.pkcs12";
/**
* Test logic (environment has set up)
*/
private void runTest() throws FileNotFoundException, CertificateException,
KeyStoreException, IOException, NoSuchAlgorithmException {
Certificate cert;
CertificateFactory cf;
try (FileInputStream fi = new FileInputStream(CERT_PATH)) {
cf = CertificateFactory.getInstance("X.509");
cert = cf.generateCertificate(fi);
KeyStore ks = KeyStore.getInstance(
Utils.KeyStoreType.pkcs12.name());
ks.load(null, null);
ks.setCertificateEntry(ALIAS, cert);
Utils.saveKeyStore(ks, KEYSTORE_PATH, PASSWORD);
ks = Utils.loadKeyStore(KEYSTORE_PATH, Utils.KeyStoreType.pkcs12,
PASSWORD);
final Certificate ksCert = ks.getCertificate(ALIAS);
if (!ksCert.equals(cert)) {
err.println("Orig cert: " + cert.toString());
err.println("Cert from keystore: " + ksCert.toString());
throw new RuntimeException("Certificates don't match");
}
}
}
public static void main(String[] args) throws Exception {
StoreTrustedCertAPITest test = new StoreTrustedCertAPITest();
test.setUp();
test.runTest();
out.println("Test Passed");
}
private void setUp() {
Utils.createKeyStore(Utils.KeyStoreType.pkcs12, KEYSTORE_PATH, ALIAS);
Utils.exportCert(Utils.KeyStoreType.pkcs12, KEYSTORE_PATH,
ALIAS, CERT_PATH);
new File(KEYSTORE_PATH).delete();
}
}

View file

@ -0,0 +1,127 @@
/*
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import java.io.File;
import java.io.IOException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import jdk.test.lib.process.OutputAnalyzer;
import static java.lang.System.out;
/**
* @test
* @bug 8048830
* @summary Tests keytool command imports certificate , list keystore, print
* certificate and import password help.
* @library ../
* @library /test/lib
* @run main StoreTrustedCertKeytool
*/
public class StoreTrustedCertKeytool {
private static final String PASSWORD = "passwd";
private static final String ALIAS = "testkey_stckey";
private static final String FILE_SEPARATOR = File.separator;
private static final String WORKING_DIRECTORY = System.getProperty(
"test.classes", "." + FILE_SEPARATOR);
private static final String CERT_PATH = WORKING_DIRECTORY
+ FILE_SEPARATOR
+ "cert.data";
private static final String KEYSTORE_PATH = WORKING_DIRECTORY
+ FILE_SEPARATOR + "ks.pkcs12";
protected void run() throws IOException, KeyStoreException,
NoSuchAlgorithmException, CertificateException {
setUp();
importCert();
out.println("Import Cert test passed");
listCerts();
out.println("listCerts test passed");
printCert();
out.println("print cert test passed");
helpImportPassword();
out.println("help import test passed");
}
private void importCert() {
final String[] command = new String[]{"-debug", "-importcert",
"-alias", ALIAS, "-file", CERT_PATH, "-noprompt", "-keystore",
KEYSTORE_PATH, "-storetype", "pkcs12", "-storepass", PASSWORD};
// If the keystore exists delete it.
File keystoreFile = new File(KEYSTORE_PATH);
if (keystoreFile.exists()) {
keystoreFile.delete();
}
Utils.executeKeytoolCommand(command);
}
private void listCerts() throws IOException, KeyStoreException,
NoSuchAlgorithmException, CertificateException {
final String[] command = new String[]{"-debug", "-list", "-v",
"-alias", ALIAS, "-keystore", KEYSTORE_PATH, "-storetype", "pkcs12",
"-storepass", PASSWORD};
OutputAnalyzer output = Utils.executeKeytoolCommand(command);
if (output == null) {
throw new RuntimeException("Keystore print fails");
}
X509Certificate ksCert = null;
final KeyStore ks = Utils.loadKeyStore(KEYSTORE_PATH,
Utils.KeyStoreType.pkcs12, PASSWORD.toCharArray());
ksCert = (X509Certificate) ks.getCertificate(ALIAS);
if (ksCert == null) {
throw new RuntimeException("Certificate " + ALIAS
+ " not found in Keystore " + KEYSTORE_PATH);
}
String serialNumber = ksCert.getSerialNumber().toString(16);
output.shouldContain(serialNumber);
}
private void printCert() {
final String[] command = new String[]{"-debug", "-printcert",
"-file", CERT_PATH};
Utils.executeKeytoolCommand(command);
}
private void helpImportPassword() {
final String[] command = new String[]{"-debug", "-help",
"-importpassword"};
Utils.executeKeytoolCommand(command);
}
public static void main(String[] args) throws Exception {
final StoreTrustedCertKeytool test = new StoreTrustedCertKeytool();
test.run();
out.println("Test Passed");
}
private void setUp() {
Utils.createKeyStore(Utils.KeyStoreType.pkcs12, KEYSTORE_PATH, ALIAS);
Utils.exportCert(Utils.KeyStoreType.pkcs12, KEYSTORE_PATH, ALIAS,
CERT_PATH);
new File(KEYSTORE_PATH).delete();
}
}

View file

@ -0,0 +1,64 @@
/*
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 8278744
* @summary KeyStore:getAttributes() not returning unmodifiable Set
* @library /test/lib
*/
import jdk.test.lib.SecurityTools;
import jdk.test.lib.Utils;
import java.io.File;
import java.security.KeyStore;
public class UnmodifiableAttributes {
public static final void main(String[] args) throws Exception {
var oneAttr = new KeyStore.Entry.Attribute() {
@Override
public String getName() {
return "1.2.3";
}
@Override
public String getValue() {
return "testVal";
}
};
char[] pass = "changeit".toCharArray();
SecurityTools.keytool("-keystore ks -storepass changeit -genkeypair -alias a -dname CN=A -keyalg EC")
.shouldHaveExitValue(0);
KeyStore ks = KeyStore.getInstance(new File("ks"), pass);
var attrs = ks.getAttributes("a");
Utils.runAndCheckException(() -> attrs.add(oneAttr), UnsupportedOperationException.class);
var attrs2 = ks.getEntry("a", new KeyStore.PasswordProtection(pass)).getAttributes();
Utils.runAndCheckException(() -> attrs2.add(oneAttr), UnsupportedOperationException.class);
}
}

View file

@ -0,0 +1,138 @@
/*
* Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.cert.CertificateException;
import java.util.Arrays;
import java.util.List;
import jdk.test.lib.process.ProcessTools;
import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.JDKToolFinder;
import static java.lang.System.out;
import java.util.ArrayList;
/**
* Helper class for creating keystore and executing keytool commands
*/
public class Utils {
public enum KeyStoreType {
jks, pkcs12;
}
public static final String DEFAULT_DNAME
= "CN=TestKey, T=FuncTestCertKey, O=Oracle, OU=JDKSQE, C=US";
public static final String DEFAULT_PASSWD = "passwd";
public static final String RSA = "rsa";
public static final String JAVA_HOME = System.getProperty("java.home");
public static final String KEYTOOL = "keytool";
private static final int SUCCESS_EXIT_CODE = 0;
public static OutputAnalyzer executeKeytoolCommand(String[] command) {
return executeKeytoolCommand(command, SUCCESS_EXIT_CODE);
}
public static OutputAnalyzer executeKeytoolCommand(String[] command,
int exitCode) {
String[] keytoolCmd = new String[command.length + 3];
OutputAnalyzer output = null;
try {
keytoolCmd[0] = JDKToolFinder.getJDKTool(KEYTOOL);
// Ensure the keytool process is always ran under English locale
keytoolCmd[1] = "-J-Duser.language=en";
keytoolCmd[2] = "-J-Duser.country=US";
System.arraycopy(command, 0, keytoolCmd, 3, command.length);
output = ProcessTools.executeCommand(keytoolCmd);
output.shouldHaveExitValue(exitCode);
out.println("Executed keytool command sucessfully:"
+ Arrays.toString(keytoolCmd));
} catch (Throwable e) {
e.printStackTrace(System.err);
throw new RuntimeException("Keytool Command execution failed : "
+ Arrays.toString(keytoolCmd), e);
}
return output;
}
public static void createKeyStore(KeyStoreType type, String name,
String alias) {
createKeyStore(DEFAULT_DNAME, type, name, alias, RSA);
}
public static void createKeyStore(String dName, KeyStoreType type,
String name, String alias, String algorithm,
String... optionalArgs) {
createKeyStore(dName, type, name, alias, algorithm, optionalArgs,
SUCCESS_EXIT_CODE);
}
public static void createKeyStore(String dName, KeyStoreType type,
String name, String alias, String algorithm,
String[] optionalArgs, int exitCode) {
String[] command = new String[]{"-debug", "-genkeypair", "-alias",
alias, "-keystore", name, "-dname", dName, "-storepass",
DEFAULT_PASSWD, "-keypass", DEFAULT_PASSWD, "-validity", "7300",
"-keyalg", algorithm, "-storetype", type.name()};
if (optionalArgs != null && optionalArgs.length > 0) {
List<String> commandArgs = new ArrayList<>(Arrays.asList(command));
List<String> temp = Arrays.asList(optionalArgs);
commandArgs.addAll(temp);
if (!commandArgs.contains(("-keysize"))) {
commandArgs.add("-keysize");
commandArgs.add("1024");
}
command = commandArgs.toArray(new String[commandArgs.size()]);
}
executeKeytoolCommand(command, exitCode);
}
public static void exportCert(KeyStoreType type, String name,
String alias, String cert) {
String[] command = {"-debug", "-exportcert", "-keystore", name,
"-storetype", type.name(), "-storepass", DEFAULT_PASSWD, "-alias",
alias,"-file",cert,"-noprompt"};
executeKeytoolCommand(command);
}
public static KeyStore loadKeyStore(String file, KeyStoreType type,
char[] passwd)
throws IOException, KeyStoreException,
NoSuchAlgorithmException, CertificateException {
KeyStore ks = KeyStore.getInstance(type.name());
try (FileInputStream fin = new FileInputStream(file)) {
ks.load(fin, passwd);
}
return ks;
}
public static void saveKeyStore(KeyStore ks, String file, char[] passwd)
throws IOException, KeyStoreException, NoSuchAlgorithmException,
CertificateException {
try (FileOutputStream fout = new FileOutputStream(file)) {
ks.store(fout, passwd);
}
}
}

View file

@ -0,0 +1,364 @@
/*
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 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, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import static java.lang.System.out;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.*;
import java.security.cert.Certificate;
import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import java.util.Arrays;
import java.util.Base64;
import java.util.Enumeration;
/*
* @test
* @bug 8048618
* @summary Write different types p12 key store to Check the write related
* APIs.
* @run main WriteP12Test
* @enablePreview
*/
public class WriteP12Test {
private static final String IN_KEYSTORE_TYPE = "jks";
private static final String IN_KEYSTORE_PRV = "SUN";
private static final String IN_KEYSTORE_ENDUSER = "keystoreEU.jks.data";
private static final String IN_KEYSTORE_CA = "keystoreCA.jks.data";
private static final String OUT_KEYSTORE = "outKeyStore.p12";
private static final String IN_STORE_PASS = "storepass";
private static final String IN_KEY_PASS = "keypass";
private static final String CERT_PATH = System.getProperty("test.src", ".")
+ File.separator + "certs" + File.separator + "writeP12"
+ File.separator;
private static final String CA_CERT_STR = "-----BEGIN CERTIFICATE-----\n"
+ "MIIDFzCCAf8CBD8+0nAwDQYJKoZIhvcNAQEFBQAwUDELMAkGA1UEBhMCV\n"
+ "VMxETAPBgNVBAoTCEphdmFTb2Z0MRUwEwYDVQQLEwxTZWN1cml0eSBTUU\n"
+ "UxFzAVBgNVBAMTDlBLQ1MxMiBUZXN0IENBMB4XDTAzMDgxNzAwNTUxMlo\n"
+ "XDTEzMDgxNDAwNTUxMlowUDELMAkGA1UEBhMCVVMxETAPBgNVBAoTCEph\n"
+ "dmFTb2Z0MRUwEwYDVQQLEwxTZWN1cml0eSBTUUUxFzAVBgNVBAMTDlBLQ\n"
+ "1MxMiBUZXN0IENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQ\n"
+ "EAk7Sh+K/yGsmJacZnjfkZfuWxGNJCPW0q69exwoRP+eBHMQwG00yi9aL\n"
+ "SsZAqNpJSCDvpgySOAUmBd+f8WFhHqJfRVREVfv3mradDKZCjhqtsUI7I\n"
+ "wRTYYy9clFkeeK4dHaxbuFMPpUu7yQfwSTXgvOA/UJ4kJuGtaYAdTJI4e\n"
+ "f1mUASo6+dea0UZA/FHCuV7O6z3hr5VHlyhJL2/o/8M5tGBTBISODJSnn\n"
+ "GNBvtQLNHnWYvs470UAE2BtuCGYh1V/3H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\n"
+ "8gHV2m8pADdRqdihBmnSQEaMW4D3uZ4sFE1LtkQls6hjd7SdOsG5Y24L8\n"
+ "15jot9a2JcB73H8H0VKirrObL5BZdt7BtASPDnYtW4Spt++YjDoJFxyF0\n"
+ "HchkavzXaVTlexakwIDAQABoxMwETAPBgNVHQ8BAf8EBQMDB4AAMA0GCS\n"
+ "qGSIb3DQEBBAUAA4GBAIFA3JXEmb9AXn3RD7t+Mn6DoyVDIy5jsn6xOKT\n"
+ "JV25I0obpDUzgw4QaAMmM0ZvusOmZ2wZNS8MtyTUgdANyakbzn5SdxbTy\n"
+ "TLEqQsFbX8UVC38fx5ZM6ExA5YSAvgmXudZpOVC0ATccoZS3JFU8CxSfW\n"
+ "+Q3IC2MLh+QTg3hUJ5b\n-----END CERTIFICATE-----";
private final Certificate testerCert;
private final Certificate testLeadCert;
private final Certificate caCert;
WriteP12Test() {
PEMDecoder pemDecoder = PEMDecoder.of();
caCert = pemDecoder.decode(CA_CERT_STR, X509Certificate.class);
testLeadCert = pemDecoder.decode(LEAD_CERT, X509Certificate.class);
testerCert = pemDecoder.decode(END_CERT, X509Certificate.class);
}
public static void main(String[] args) throws UnrecoverableKeyException,
KeyStoreException, NoSuchProviderException,
NoSuchAlgorithmException, IOException, CertificateException {
WriteP12Test jstest = new WriteP12Test();
out.println("test WriteP12CertChain");
/*
* WriteP12CertChain: This test creates a p12 keystore contains one
* entry with private key and a certificate chains contains three
* certificates in the order of user->lead->ca. This case expects to
* pass.
*/
jstest.test(new Certificate[] { jstest.testerCert, jstest.testLeadCert,
jstest.caCert }, IN_KEYSTORE_ENDUSER, "pkcs12testenduser1",
"pass", "pass");
/*
* WriteP12CertChainBad: same as WriteP12CertChain but chains order is
* user-ca-lead, the order is wrong so expects to fail.
*/
out.println("test WriteP12CertChainBad");
try {
jstest.test(new Certificate[] { jstest.testerCert, jstest.caCert,
jstest.testLeadCert }, IN_KEYSTORE_ENDUSER,
"pkcs12testenduser1", "pass", "pass");
throw new RuntimeException(
" Certificate chain is not valid, test should not pass."
+ " Test failed.");
} catch (KeyStoreException e) {
e.printStackTrace();
out.println(" Certificate chain is not valid,exception is"
+ " expected. Test passed.");
}
/*
* WriteP12PrivateKey:This test creates a p12 contains a self-signed
* cert and private key,expects no exception
*/
out.println("test WriteP12PrivateKey");
jstest.test(null, IN_KEYSTORE_ENDUSER, "pkcs12testenduser1", "pass",
"pass");
/*
* WriteP12TwoEntry: This test creates a p12 keystore with different
* storepass and keypass, and contains two entries.
*/
out.println("test WriteP12TwoEntry");
jstest.testTwoEntry(IN_KEYSTORE_ENDUSER, IN_KEYSTORE_CA,
"pkcs12testenduser1", "pass", "pass");
/*
* WriteP12TwoPass: This test creates a p12 keystore with different
* storepass and keypass, and contains one entry with private key and a
* certificate
*/
out.println("test WriteP12TwoPass");
jstest.test(null, IN_KEYSTORE_CA, "pkcs12testCA", "storepass",
"keypass");
}
private void test(Certificate certs[], String inKeyStorePath,
String userAlias, String outStorePass, String outKeyPass)
throws KeyStoreException, NoSuchProviderException, IOException,
CertificateException, UnrecoverableKeyException,
NoSuchAlgorithmException {
// init output key store
KeyStore outputKeyStore = KeyStore.getInstance("pkcs12", "SunJSSE");
outputKeyStore.load(null, null);
try (FileOutputStream fout = new FileOutputStream(OUT_KEYSTORE)) {
// KeyStore have encoded by Base64.getMimeEncoder().encode(),need
// decode first.
byte[] input = Files.readAllBytes(Paths.get(CERT_PATH,
inKeyStorePath));
ByteArrayInputStream arrayIn = new ByteArrayInputStream(Base64
.getMimeDecoder().decode(input));
// input key store
KeyStore inputKeyStore = KeyStore.getInstance(IN_KEYSTORE_TYPE,
IN_KEYSTORE_PRV);
inputKeyStore.load(arrayIn, IN_STORE_PASS.toCharArray());
// add key/certificate to output key store
Key key = inputKeyStore
.getKey(userAlias, IN_KEY_PASS.toCharArray());
out.println("Input Key Algorithm " + key.getAlgorithm());
out.println("====Input Certs=====");
if (certs == null) {
certs = new Certificate[] { inputKeyStore
.getCertificate(userAlias) };
}
for (Certificate cert : certs) {
out.println(((X509Certificate) cert).getSubjectDN());
}
outputKeyStore.setKeyEntry(userAlias, key,
outKeyPass.toCharArray(), certs);
Certificate retCerts[] = outputKeyStore
.getCertificateChain(userAlias);
out.println("====Output Certs=====");
for (Certificate retCert : retCerts) {
out.println(((X509Certificate) retCert).getSubjectDN());
}
out.println("====Output Key Algorithm=====");
Key outKey = outputKeyStore.getKey(userAlias,
outKeyPass.toCharArray());
out.println(outKey.getAlgorithm());
if (!key.equals(outKey)) {
throw new RuntimeException("key don't match");
}
if (!Arrays.equals(certs, retCerts)) {
throw new RuntimeException("certs don't match");
}
// save output
outputKeyStore.store(fout, outStorePass.toCharArray());
// test output
testKeyStore(outputKeyStore, outKeyPass.toCharArray());
}
}
private void testTwoEntry(String inKeyStoreOnePath,
String inKeyStoreTwoPath, String userAlias, String outStorePass,
String outKeyPass) throws KeyStoreException,
NoSuchProviderException, NoSuchAlgorithmException,
CertificateException, IOException, UnrecoverableKeyException {
// initial KeyStore
KeyStore outputKeyStore = KeyStore.getInstance("pkcs12", "SunJSSE");
try (FileOutputStream fout = new FileOutputStream(OUT_KEYSTORE);) {
outputKeyStore.load(null, null);
KeyStore inputKeyStoreOne, inputKeyStoreTwo;
inputKeyStoreOne = KeyStore.getInstance(IN_KEYSTORE_TYPE,
IN_KEYSTORE_PRV);
// KeyStore have encoded by Base64.getMimeEncoder().encode(),need
// decode first.
byte[] inputBytes = Files.readAllBytes(Paths.get(CERT_PATH,
inKeyStoreOnePath));
ByteArrayInputStream arrayIn = new ByteArrayInputStream(Base64
.getMimeDecoder().decode(inputBytes));
// input key store
inputKeyStoreOne.load(arrayIn, IN_STORE_PASS.toCharArray());
inputBytes = Files.readAllBytes(Paths.get(CERT_PATH,
inKeyStoreTwoPath));
arrayIn = new ByteArrayInputStream(Base64.getMimeDecoder().decode(
inputBytes));
inputKeyStoreTwo = KeyStore.getInstance(IN_KEYSTORE_TYPE,
IN_KEYSTORE_PRV);
inputKeyStoreTwo.load(arrayIn, IN_STORE_PASS.toCharArray());
// add key/certificate to output key store
out.println("====First Entry=====");
Key inputKey = inputKeyStoreOne.getKey(userAlias,
IN_KEY_PASS.toCharArray());
Certificate cert = inputKeyStoreOne.getCertificate(userAlias);
Certificate certs[] = new Certificate[1];
certs[0] = cert;
out.println("====Input1 Key=====");
out.println(inputKey.getAlgorithm());
out.println("====Input1 Certs=====");
out.println("Certificate :");
out.println(((X509Certificate) cert).getSubjectDN());
outputKeyStore.setKeyEntry("USER", inputKey,
outKeyPass.toCharArray(), certs);
out.println("====Second Entry=====");
String caAlias = "pkcs12testca";
inputKey = inputKeyStoreTwo.getKey(caAlias,
IN_KEY_PASS.toCharArray());
cert = inputKeyStoreTwo.getCertificate(caAlias);
certs[0] = cert;
out.println("====Input2 Key=====");
out.println(inputKey.getAlgorithm());
out.println("====Input2 Certs=====");
out.println("Certificate :");
out.println(((X509Certificate) cert).getSubjectDN());
outputKeyStore.setKeyEntry("CA", inputKey,
outKeyPass.toCharArray(), certs);
// save output
outputKeyStore.store(fout, outStorePass.toCharArray());
// test output
testKeyStore(outputKeyStore, outKeyPass.toCharArray());
}
}
private void testKeyStore(KeyStore inputKeyStore, char[] keypass)
throws KeyStoreException, UnrecoverableKeyException,
NoSuchAlgorithmException {
out.println("========== Key Store ==========");
out.println("getProvider : " + inputKeyStore.getProvider());
out.println("getType : " + inputKeyStore.getType());
out.println("getDefaultType : " + KeyStore.getDefaultType());
int idx = 0;
Enumeration<String> e = inputKeyStore.aliases();
String alias;
while (e.hasMoreElements()) {
alias = e.nextElement();
if (!inputKeyStore.containsAlias(alias)) {
throw new RuntimeException("Alias not found");
}
out.println("Alias " + idx + " : " + alias);
out.println("getCreationDate : "
+ inputKeyStore.getCreationDate(alias));
X509Certificate cert = (X509Certificate) inputKeyStore
.getCertificate(alias);
out.println("getCertificate : " + cert.getSubjectDN());
String retAlias = inputKeyStore.getCertificateAlias(cert);
if (!retAlias.equals(alias)) {
throw new RuntimeException("Alias mismatch, actually "
+ retAlias + ", expected " + alias);
}
out.println("getCertificateAlias : " + retAlias);
Certificate[] certs = inputKeyStore.getCertificateChain(alias);
int i = 0;
for (Certificate certification : certs) {
out.println("getCertificateChain " + i
+ ((X509Certificate) certification).getSubjectDN());
i++;
}
if (inputKeyStore.isCertificateEntry(alias)) {
throw new RuntimeException(
"inputKeystore should not be certEntry because this"
+ " keystore only contain key pair entries.");
}
if (!inputKeyStore.isKeyEntry(alias)) {
throw new RuntimeException("Entry type unknown.");
}
idx++;
}
int size = inputKeyStore.size();
if (idx != size) {
throw new RuntimeException("Size not match, actually " + idx
+ ", expected " + size);
}
}
}

View file

@ -0,0 +1,76 @@
MIIQ6AIBAzCCEKIGCSqGSIb3DQEHAaCCEJMEghCPMIIQizCCBXAGCSqGSIb3DQEHAaCCBWEEggVd
MIIFWTCCBVUGCyqGSIb3DQEMCgECoIIE+jCCBPYwKAYKKoZIhvcNAQwBAzAaBBSKdWqt6IsXyQA9
6SNtYnk7vaT/CQICBAAEggTIv5XR91OsI7r831ltprYhtOfAhl3TFKj+cqnohJF1xm60K5dQN5BZ
enfVw4YPbCTR16+zTiGyHJ/MFELwOrOogPdSQBTuy1PtUZOfskD/EKFQaCVSQ1omNlgOWqVh0dhF
TMjw6KLaTfhwx2Qw3aLIjhy7rvS5SEsUbGZ/IvJ7ym+DHzFuP8oQFfISUkNxh7wOqk4BSsY1Yh9H
JbK7Y7JtWReDTbAtuACQSPO0Z7RSWKC2y29cG6x3gIiB8iKTNrPKc6m0wb48RKipzF6r35GQRMoS
rsordIc22RS/KYFfU4W9LAdV+/vJBuZazc+3MgcOXYUWDaMpAG697aim1yDjudcVnPoUdzdWQvAj
Z7dHqeplZ8h4Ur+dKH3EeWoipXBXhVI0i9hFbOU+36OZ96LUjlRfaAI3NXVMEa9+kATwDHh9cqnQ
1zkbVPCXBY6Y6+wnq5o0mpES++MCc8zELiFYZOJl6UWBE/D16QAv+6Qd/JHmRaZfNt+vNxKm1ltm
nvdyWcO4FlF9F5cC66AS3N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Y879EC+3U8NgA84O3YZKfNxE4uSbjeGKu4tvVp5DoByW
H7ZZWKAScltteuKFpP4ME6gGwvgF122HNzfrwztjcooIGfsxRvRSNerbAVjyZbBy3jC/3m3pOmqy
kJfzhbVqEesBRCJKaCXVHZRSoziSqlwtMgbU+tPYGMERJT727cIFFKhqLILybZbc6LKI/SV852TD
JXQ420HZX76GTSEWURDsu8glvYuGVosvBdg/63lVf8z15vJiaFbJEQDR7dHAquTAsynB2PVUErhJ
sNz4kuQRbRoD6vS07fM2avNTLouZUX3bpwugyumgl2H0lvxLWXnXelFHnIc7NzdEqx6oS1YZBgq3
7U21OG5t9hA02eZZT+LrcAWH1NUV2fFWps60WHKdCKcIN7w/vy/D8dDr1jdOppdubN35oR5ZOwob
HYjk/KepGNTDeH8el2SX9yhjj5a0aTtMTdy/DvpAN7u9Xaq0bRH1lZZyE0n4F1MysND8sWwQPTH8
uJoD4msqelGrx81lThyhwwk/8+2AWGG0sU9l0sK4xMmeMCPtdGdg9C4g5m08mHoa/etbOj+7spqf
MG4Gq1hLOygsHwFRRQe3eRi4BSoE7HvgdyP84qVnLnc4g0RDLhFdDgyBLGTYRqpCX8iZA4Nf4uRJ
pteB+CANzKjx9HqxBO/jGtOwFBg0eSXBU4d4CI6MoAS4NxUjlqhIGEKJBwJ78jPsCq2JMD0wITAJ
BgUrDgMCGgUABBTxMWXHZ4F5ADtYXqKlpD5cMihu7wQUsiXIcUR/3TChw09nR5rrIaFsN+MCAgQA

View file

@ -0,0 +1,7 @@
SHA1: 09:F1:08:B1:B3:28:22:23:22:F7:5F:6D:4A:8D:0E:0A:5E:6D:56:FB
SHA256: AD:57:47:67:20:96:49:86:53:E4:10:EF:BD:4D:D2:B0:81:C0:B0:BB:62:AE:BE:47:80:DC:00:F8:E3:E7:66:B5
SHA1: 2B:CE:0C:E1:35:B9:9D:FE:5A:6E:25:88:01:F7:E9:E5:7B:89:17:42
SHA256: 65:F3:0A:64:F2:52:B2:4E:F8:76:C5:D0:6D:53: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/t1USs8+gZPS+kLfE3wxZefo1nFmbkTWQT6hW+z4zh
0QoBNwGJVFYxPuGvyOmQ4ksEHe7G8fc7ihkiZ+A9fJROqOjVA/ThnWIuiLKbDFlW1rQbdlihQy7Z
oKbzbA9eOMUCaXMEti5CG/97pOCiElARHDactfiy0J7ykjCGLCkw1/3j5Qdr3feN4GWqOBTfn0cK
eq8RT0pBkT0wOzAfMAcGBSsOAwIaBBRW5H12kY01oB2hnm0lkT0yUbjP4wQUF7tfAlojMdSZIdKB
/FfU1hlVl8YCAgfQ

Some files were not shown because too many files have changed in this diff Show more