Package com.southernstorm.noise.protocol
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 SummaryConstructors Constructor Description CipherStatePair(CipherState sender, CipherState receiver)Constructs a pair of CipherState objects.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()Destroys all sensitive state in the current object.CipherStategetReceiver()Gets the CipherState to use to receive packets from the remote party.CipherStategetSender()Gets the CipherState to use to send packets to the remote party.voidreceiverOnly()Destroys the sending CipherState and retains only the receiving CipherState.voidsenderOnly()Destroys the receiving CipherState and retains only the sending CipherState.voidswap()Swaps the sender and receiver.
 
- 
- 
- 
Constructor Detail- 
CipherStatePairpublic 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 Detail- 
getSenderpublic CipherState getSender() Gets the CipherState to use to send packets to the remote party.- Returns:
- The sending CipherState.
 
 - 
getReceiverpublic CipherState getReceiver() Gets the CipherState to use to receive packets from the remote party.- Returns:
- The receiving CipherState.
 
 - 
senderOnlypublic void senderOnly() Destroys the receiving CipherState and retains only the sending CipherState. This function is intended for use with one-way handshake patterns.
 - 
receiverOnlypublic void receiverOnly() Destroys the sending CipherState and retains only the receiving CipherState. This function is intended for use with one-way handshake patterns.
 - 
swappublic void swap() Swaps the sender and receiver.
 - 
destroypublic void destroy() Description copied from interface:DestroyableDestroys all sensitive state in the current object.- Specified by:
- destroyin interface- Destroyable
 
 
- 
 
-