Skip to content

Commit e49367b

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

File tree

9 files changed

+1778
-13
lines changed

9 files changed

+1778
-13
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1568,6 +1568,7 @@ private static void addEngine(String name, boolean sp, Class<?> constructorParam
15681568
addEngine("KeyAgreement", true, null);
15691569
addEngine("KeyGenerator", false, null);
15701570
addEngine("SecretKeyFactory", false, null);
1571+
addEngine("KEM", true, null);
15711572
// JSSE
15721573
addEngine("KeyManagerFactory", false, null);
15731574
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)