Interface KeyEncapsulationResult
- All Known Implementing Classes:
InternalKeyEncapsulationResult
@Preview(name="Property Encryption")
public sealed interface KeyEncapsulationResult
permits InternalKeyEncapsulationResult
The result of a key encapsulation operation.
Contains the encapsulated key, the metadata required to decapsulate it, and the key itself.
- Since:
- 6.3.0
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]Returns the encapsulated key.key()Returns the key.metadata()Returns the metadata associated with the encapsulated key.static KeyEncapsulationResultReturns a new instance ofKeyEncapsulationResult.
-
Method Details
-
of
Returns a new instance ofKeyEncapsulationResult.- Parameters:
encapsulation- the encapsulation bytes, must not be nullmetadata- the encapsulation metadata, must not be nullkey- the new key, must not be null- Returns:
- the new encapsulation result
-
encapsulation
byte[] encapsulation()Returns the encapsulated key.- Returns:
- the encapsulation bytes
-
metadata
Returns the metadata associated with the encapsulated key.The metadata is provided to the
BaseKeyEncapsulationServicewhen the key is decapsulated.- Returns:
- the key metadata
-
key
-