Class KEM.Encapsulated
java.lang.Object
javax.crypto.KEM.Encapsulated
- Enclosing class:
- KEM
This class specifies the return value of the encapsulate method of
a Key Encapsulation Mechanism (KEM), which includes the shared secret
(as a 
SecretKey), the key encapsulation message,
and optional parameters.
Note: the key encapsulation message can be also referred to as ciphertext.
- Since:
- 21
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionEncapsulated(SecretKey key, byte[] encapsulation, byte[] params) Constructs anEncapsulatedobject.
- 
Method Summary
- 
Constructor Details- 
EncapsulatedConstructs anEncapsulatedobject.- Parameters:
- key- the shared secret as a key, must not be- null.
- encapsulation- the key encapsulation message, must not be- null. The contents of the array are copied to protect against subsequent modification.
- params- optional parameters, can be- null. The contents of the array are copied to protect against subsequent modification.
- Throws:
- NullPointerException- if- keyor- encapsulationis- null
 
 
- 
- 
Method Details- 
key
- 
encapsulationpublic byte[] encapsulation()Returns the key encapsulation message.- Returns:
- the key encapsulation message. A new copy of the byte array is returned.
 
- 
paramspublic byte[] params()Returns the optional parameters in a byte array.- Returns:
- the optional parameters in a byte array or nullif not specified. A new copy of the byte array is returned.
 
 
-