java.lang.Object
org.bouncycastle.pqc.crypto.util.SecretWithEncapsulationImpl
All Implemented Interfaces:
Destroyable, SecretWithEncapsulation

public class SecretWithEncapsulationImplextends Object implements SecretWithEncapsulation
Implementation of SecretWithEncapsulation for post-quantum cryptography. Provides secure storage and destruction of encapsulated secrets and session keys.
  • Field Details

    • hasBeenDestroyed

      private final AtomicBoolean hasBeenDestroyed
      Set once the key material has been wiped.
    • sessionKey

      private final byte[] sessionKey
      The shared secret that was established.
    • cipher_text

      private final byte[] cipher_text
      The encapsulated key sent to the other side.
  • Constructor Details

    • SecretWithEncapsulationImpl

      public SecretWithEncapsulationImpl(byte[] sessionKey, byte[] cipher_text)
      Stores the shared key and the encapsulated key.
      Parameters:
      sessionKey - the shared key agreed by the KEM, zeroed by destroy() and copied on every read
      cipher_text - the encapsulated key produced by the encapsulator, zeroed by destroy() and copied on every read
  • Method Details