Class CipherStatePair

java.lang.Object
com.southernstorm.noise.protocol.CipherStatePair
All Implemented Interfaces:
Destroyable

public final class CipherStatePair extends Object implements Destroyable
Class that contains a pair of CipherState objects. CipherState pairs typically arise when HandshakeState.split() is called.
  • Constructor Details

    • CipherStatePair

      public CipherStatePair(CipherState sender, CipherState receiver)
      Constructs a pair of CipherState objects.
      Parameters:
      sender - The CipherState to use to send packets to the remote party.
      receiver - The CipherState to use to receive packets from the remote party.
  • Method Details

    • getSender

      public CipherState getSender()
      Gets the CipherState to use to send packets to the remote party.
      Returns:
      The sending CipherState.
    • getReceiver

      public CipherState getReceiver()
      Gets the CipherState to use to receive packets from the remote party.
      Returns:
      The receiving CipherState.
    • senderOnly

      public void senderOnly()
      Destroys the receiving CipherState and retains only the sending CipherState. This function is intended for use with one-way handshake patterns.
    • receiverOnly

      public void receiverOnly()
      Destroys the sending CipherState and retains only the receiving CipherState. This function is intended for use with one-way handshake patterns.
    • swap

      public void swap()
      Swaps the sender and receiver.
    • destroy

      public void destroy()
      Description copied from interface: Destroyable
      Destroys all sensitive state in the current object.
      Specified by:
      destroy in interface Destroyable