KEMSpi
public static interface KEMSpi.DecapsulatorSpi
KEMSpi.engineNewDecapsulator(java.security.PrivateKey, java.security.spec.AlgorithmParameterSpec)
on the KEM receiver side.Modifier and Type | Method | Description |
---|---|---|
SecretKey |
engineDecapsulate |
The key decapsulation function. |
int |
engineEncapsulationSize() |
Returns the size of the key encapsulation message. |
int |
engineSecretSize() |
Returns the size of the shared secret. |
SecretKey engineDecapsulate(byte[] encapsulation, int from, int to, String algorithm) throws DecapsulateException
An invocation of this method recovers the secret key from the key encapsulation message.
An implementation must support the case where from
is 0, to
is the same as the return value of secretSize()
, and algorithm
is "Generic".
encapsulation
- the key encapsulation message from the sender. The size must be equal to the value returned by engineEncapsulationSize()
()}, or a DecapsulateException
must be thrown.from
- the initial index of the shared secret byte array to be returned, inclusiveto
- the final index of the shared secret byte array to be returned, exclusivealgorithm
- the algorithm name for the secret key that is returnedSecretKey
with the specified algorithmDecapsulateException
- if an error occurs during the decapsulation processIndexOutOfBoundsException
- if from < 0
, from > to
, or to > secretSize()
NullPointerException
- if encapsulation
or algorithm
is null
UnsupportedOperationException
- if the combination of from
, to
, and algorithm
is not supported by the decapsulatorint engineSecretSize()
int engineEncapsulationSize()
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.base/javax/crypto/KEMSpi.DecapsulatorSpi.html