Skip to content
This repository was archived by the owner on Oct 1, 2025. It is now read-only.

Commit e9d2641

Browse files
committed
8297878: KEM: Implementation
8322971: KEM.getInstance() should check if a 3rd-party security provider is signed Reviewed-by: mullan, iris, andrew
1 parent af9a602 commit e9d2641

File tree

9 files changed

+1779
-14
lines changed

9 files changed

+1779
-14
lines changed

src/java.base/share/classes/java/security/Provider.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1996, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -1564,6 +1564,7 @@ private static void addEngine(String name, boolean sp, String paramName) {
15641564
addEngine("KeyAgreement", true, null);
15651565
addEngine("KeyGenerator", false, null);
15661566
addEngine("SecretKeyFactory", false, null);
1567+
addEngine("KEM", true, null);
15671568
// JSSE
15681569
addEngine("KeyManagerFactory", false, null);
15691570
addEngine("SSLContext", false, null);
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/*
2+
* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation. Oracle designates this
8+
* particular file as subject to the "Classpath" exception as provided
9+
* by Oracle in the LICENSE file that accompanied this code.
10+
*
11+
* This code is distributed in the hope that it will be useful, but WITHOUT
12+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+
* version 2 for more details (a copy is included in the LICENSE file that
15+
* accompanied this code).
16+
*
17+
* You should have received a copy of the GNU General Public License version
18+
* 2 along with this work; if not, write to the Free Software Foundation,
19+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+
*
21+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+
* or visit www.oracle.com if you need additional information or have any
23+
* questions.
24+
*/
25+
package javax.crypto;
26+
27+
import java.security.GeneralSecurityException;
28+
29+
/**
30+
* An exception that is thrown by the
31+
* {@link javax.crypto.KEM.Decapsulator#decapsulate} method to denote an
32+
* error during decapsulation.
33+
*
34+
* @apiNote This class is defined in Java SE 17 Maintenance Release 1.
35+
* @since 17
36+
*/
37+
public class DecapsulateException extends GeneralSecurityException {
38+
39+
@java.io.Serial
40+
private static final long serialVersionUID = 21L;
41+
42+
/**
43+
* Creates a {@code DecapsulateException} with the specified
44+
* detail message.
45+
*
46+
* @param message the detail message (which is saved for later retrieval
47+
* by the {@link #getMessage()} method).
48+
*/
49+
public DecapsulateException(String message) {
50+
super(message);
51+
}
52+
53+
/**
54+
* Creates a {@code DecapsulateException} with the specified
55+
* detail message and cause.
56+
*
57+
* @param message the detail message (which is saved for later retrieval
58+
* by the {@link #getMessage()} method).
59+
* @param cause the cause (which is saved for later retrieval by the
60+
* {@link #getCause()} method). (A {@code null} value is permitted,
61+
* and indicates that the cause is nonexistent or unknown.)
62+
*/
63+
public DecapsulateException(String message, Throwable cause) {
64+
super(message, cause);
65+
}
66+
}

0 commit comments

Comments
 (0)