- 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 SummaryModifier and TypeMethodDescriptionengineEncapsulate(int from, int to, String algorithm) The key encapsulation function.intReturns the size of the key encapsulation message.intReturns the size of the shared secret.
- 
Method Details- 
engineEncapsulateThe key encapsulation function.Each invocation of this method must generate a new secret key and key encapsulation message that is returned in an KEM.Encapsulatedobject.An implementation must support the case where fromis 0,tois the same as the return value ofsecretSize(), andalgorithmis "Generic".- Parameters:
- from- the initial index of the shared secret byte array to be returned, inclusive
- to- the final index of the shared secret byte array to be returned, exclusive
- algorithm- the algorithm name for the secret key that is returned
- Returns:
- an KEM.Encapsulatedobject containing a portion of the shared secret as a key with the specified algorithm, key encapsulation message, and optional parameters.
- Throws:
- IndexOutOfBoundsException- if- from < 0,- from > to, or- to > secretSize()
- NullPointerException- if- algorithmis- null
- UnsupportedOperationException- if the combination of- from,- to, and- algorithmis not supported by the encapsulator
- See Also:
 
- 
engineSecretSizeint engineSecretSize()Returns the size of the shared secret.- Returns:
- the size of the shared secret as a finite non-negative integer
- See Also:
 
- 
engineEncapsulationSizeint 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:
 
 
-