- Enclosing interface:
KEMSpi
public static interface KEMSpi.EncapsulatorSpi
The KEM encapsulator implementation, generated by
KEMSpi.engineNewEncapsulator(java.security.PublicKey, java.security.spec.AlgorithmParameterSpec, java.security.SecureRandom)
on the KEM sender side.- Since:
- 21
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionengineEncapsulate
(int from, int to, String algorithm) The key encapsulation function.int
Returns the size of the key encapsulation message.int
Returns the size of the shared secret.
-
Method Details
-
engineEncapsulate
The key encapsulation function.Each invocation of this method must generate a new secret key and key encapsulation message that is returned in an
KEM.Encapsulated
object.An implementation must support the case where
from
is 0,to
is the same as the return value ofsecretSize()
, andalgorithm
is "Generic".- Parameters:
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 returned- Returns:
- an
KEM.Encapsulated
object containing a portion of the shared secret as a key with the specified algorithm, key encapsulation message, and optional parameters. - Throws:
IndexOutOfBoundsException
- iffrom < 0
,from > to
, orto > secretSize()
NullPointerException
- ifalgorithm
isnull
UnsupportedOperationException
- if the combination offrom
,to
, andalgorithm
is not supported by the encapsulator- See Also:
-
engineSecretSize
int engineSecretSize()Returns the size of the shared secret.- Returns:
- the size of the shared secret as a finite non-negative integer
- See Also:
-
engineEncapsulationSize
int engineEncapsulationSize()Returns the size of the key encapsulation message.- Returns:
- the size of the key encapsulation message as a finite non-negative integer
- See Also:
-