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 Details

    • of

      static KeyEncapsulationResult of(byte[] encapsulation, Map<String,String> metadata, SecretKey key)
      Returns a new instance of KeyEncapsulationResult.
      Parameters:
      encapsulation - the encapsulation bytes, must not be null
      metadata - the encapsulation metadata, must not be null
      key - the new key, must not be null
      Returns:
      the new encapsulation result
    • encapsulation

      byte[] encapsulation()
      Returns the encapsulated key.
      Returns:
      the encapsulation bytes
    • metadata

      Map<String,String> metadata()
      Returns the metadata associated with the encapsulated key.

      The metadata is provided to the BaseKeyEncapsulationService when the key is decapsulated.

      Returns:
      the key metadata
    • key

      SecretKey key()
      Returns the key.
      Returns:
      the key