Package anbxj

# Class AnB_Session

java.lang.Object
anbxj.AnB_Crypto_Wrapper
anbxj.AnB_Session

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

- ## Field Summary

  ### Fields inherited from class anbxj.AnB_Crypto_Wrapper

  `ee, ident_ks, me`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AnB_Session(Crypto_KeyStoreSettings_Map kssd, Channel_Settings cs, boolean exchange_id, Crypto_Config config)`
  Constructs a new AnB_Session with the specified parameters.
  `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.
  `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.
  `AnB_Session(String myAlias, Channel_Settings cs, boolean exchange_id, Crypto_Config config)`
  Constructs a new AnB_Session with the specified parameters.
  `AnB_Session(String myAlias, Channel_Settings cs, String id_Remote_alias, Crypto_Config config)`
  Constructs a new AnB_Session with the specified parameters.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `Close()`
  Closes the session by closing the channel and logging the closure.
  `Channel_Abstraction`
  `getChannel()`
  Gets the current channel.
  `AnBx_Agent`
  `getId_Remote()`
  Gets the remote identity (AnBx_Agent).
  `void`
  `Open()`
  Opens the session by initiating the channel, exchanging IDs if required.
  `Object`
  `Receive()`
  Receives an object using the current channel.
  `AnBx_Agent`
  `Receive_RemoteId()`
  Receives the remote identity (AnBx_Agent) using the current channel.
  `void`
  `Send(Object obj)`
  Sends an object using the current channel.
  `void`
  `Send_Id()`
  Sends the local identity (me) using the current channel.
  `void`
  `setChannel(Channel_Abstraction c)`
  Sets the current channel.
  `void`
  `setId_Remote(AnBx_Agent id_Remote)`
  Sets the remote identity (AnBx_Agent).

  ### Methods inherited from class anbxj.AnB_Crypto_Wrapper

  `aliasExists, checkHmac, decrypt, decrypt, decrypt, decrypt, encrypt, encrypt, encrypt, encrypt, encrypt, getHmacKey, getInfo, getKeyEx_KeyPair, getKeyEx_PublicKey, getKeyEx_SecretKey, getKeyPair, getKeyStoreSettings_Map, getMyIdentity, getName, getNonce, getPublicKey, getPublicKey, getRemoteCertificate, getRemoteCertificates, getSeqNumber, getSymmetricKey, getSymmetricKey, getSymmetricKeyPBE, getTimeStamp, isLoggingExecTimeEnabled, makeDigest, makeHmac, readObject, Receive, Receive_RemoteId, Send, Send_Id, setLoggingExecTimeEnabled, sign, sign, sign, verify, verify, verify, writeObject, xor`

  ### Methods inherited from class java.lang.Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### AnB_Session

    public AnB_Session(String myAlias, Channel_Settings cs, boolean exchange_id, Crypto_Config config)
    Constructs a new AnB_Session with the specified parameters.
    Parameters:
      `myAlias` - Alias of the principal.
      `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, 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.

  - ### AnB_Session

    public AnB_Session(String myAlias, Channel_Settings cs, String id_Remote_alias, Crypto_Config config)
    Constructs a new AnB_Session with the specified parameters.
    Parameters:
      `myAlias` - Alias of the principal.
      `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.