Package anbxj

Class AnB_Session


public class AnB_Session extends AnB_Crypto_Wrapper
AnB Session: implements a protocol session supporting cryptographic operations
  • Constructor Details

    • AnB_Session

      public AnB_Session(Crypto_KeyStoreSettings_Map kssd, Channel_Settings cs, boolean exchange_id, Crypto_Config config)
      Constructs a new AnB_Session with the specified parameters.
      Parameters:
      kssd - The Crypto_KeyStoreSettings_Map to be used.
      cs - The Channel_Settings for initialising channels.
      exchange_id - A boolean indicating whether to exchange ID.
      config - The Crypto_Config to be used.
    • AnB_Session

      public AnB_Session(Crypto_KeyStoreSettings_Map kssd, Channel_Settings cs, AnBx_Agent id_Remote, Crypto_Config config)
      Constructs a new AnB_Session with the specified parameters.
      Parameters:
      kssd - The Crypto_KeyStoreSettings_Map to be used.
      cs - The Channel_Settings for initialising channels.
      id_Remote - The AnBx_Agent representing the remote ID.
      config - The Crypto_Config to be used.
    • AnB_Session

      public AnB_Session(Crypto_KeyStoreSettings_Map kssd, Channel_Settings cs, String id_Remote_alias, Crypto_Config config)
      Constructs a new AnB_Session with the specified parameters.
      Parameters:
      kssd - The Crypto_KeyStoreSettings_Map to be used.
      cs - The Channel_Settings for initialising channels.
      id_Remote_alias - The alias for the remote ID.
      config - The Crypto_Config to be used.
  • Method Details

    • Open

      public void Open()
      Opens the session by initiating the channel, exchanging IDs if required.
    • Close

      public void Close()
      Closes the session by closing the channel and logging the closure.
    • Receive

      public Object Receive()
      Receives an object using the current channel.
      Returns:
      The received object.
    • Send

      public void Send(Object obj)
      Sends an object using the current channel.
      Parameters:
      obj - The object to be sent.
    • Receive_RemoteId

      public AnBx_Agent Receive_RemoteId()
      Receives the remote identity (AnBx_Agent) using the current channel.
      Returns:
      The received AnBx_Agent representing the remote identity.
    • Send_Id

      public void Send_Id()
      Sends the local identity (me) using the current channel.
    • getChannel

      public Channel_Abstraction getChannel()
      Gets the current channel.
      Returns:
      The current channel.
    • getId_Remote

      public AnBx_Agent getId_Remote()
      Gets the remote identity (AnBx_Agent).
      Returns:
      The remote identity.
    • setChannel

      public void setChannel(Channel_Abstraction c)
      Sets the current channel.
      Parameters:
      c - The channel to be set.
    • setId_Remote

      public void setId_Remote(AnBx_Agent id_Remote)
      Sets the remote identity (AnBx_Agent).
      Parameters:
      id_Remote - The remote identity to be set.