Package anbxj

# Class AnB_Principal

java.lang.Object
anbxj.AnB_Principal

Direct Known Subclasses:
  `AnBx_Principal`

public abstract class AnB_Principal extends Object
AnB Principal: A concrete principal for AnB/AnBx protocols.

This abstract class serves as a concrete implementation of a principal for AnB/AnBx protocols. It initialises AnB sessions based on provided key store settings, channel settings, aliases, and configuration. It also provides methods to run AnB protocols using the initialised sessions.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected Map<String,String>`
  `aliases`
  Mapping agent aliases
  `protected boolean`
  `exchange_identities`
  Flag to automatically exchange identities during session if set to true
  `protected Map<String,AnB_Session>`
  `lbs`
  Mapping agent identities and sessions

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AnB_Principal(Crypto_KeyStoreSettings_Map kssd, Map<String,Channel_Settings> cs, Map<String,String> aliases)`
  Constructor for AnB_Principal with specified key store settings, channel settings, and aliases.
  `AnB_Principal(Crypto_KeyStoreSettings_Map kssd, Map<String,Channel_Settings> cs, Map<String,String> aliases, Crypto_Config config)`
  Constructor for AnB_Principal with specified key store settings, channel settings, aliases, and configuration.
  `AnB_Principal(String myAlias, String path, Map<String,Channel_Settings> cs, Map<String,String> aliases)`
  Constructor for AnB_Principal with specified alias, path, channel settings, and aliases.
  `AnB_Principal(String myAlias, String path, Map<String,Channel_Settings> cs, Map<String,String> aliases, boolean needKeyStore)`
  Constructor for AnB_Principal with specified alias, path, channel settings, aliases, and needKeyStore.
  `AnB_Principal(String myAlias, String path, Map<String,Channel_Settings> cs, Map<String,String> aliases, boolean needKeyStore, Crypto_Config config)`
  Constructor for AnB_Principal with specified alias, path, channel settings, aliases, and configuration.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected void`
  `init(Crypto_KeyStoreSettings_Map kssd, Map<String,Channel_Settings> cs, Crypto_Config config)`
  Initialises AnB sessions based on provided key store settings, channel settings, and configuration.
  `protected void`
  `init(String myAlias, Map<String,Channel_Settings> cs, Crypto_Config config)`
  Initialises AnB sessions based on provided alias, channel settings, and configuration.
  `<S extends Enum<?>, R extends Enum<?>>
  void`
  `run(AnB_Protocol<S,R> prot)`
  Runs the specified AnB protocol.
  `<S extends Enum<?>, R extends Enum<?>>
  void`
  `run(AnB_Protocol<S,R> prot, long sessions)`
  Runs the specified AnB protocol with a specified number of sessions.

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

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

- ## Field Details

  - ### exchange_identities

    protected boolean exchange_identities
    Flag to automatically exchange identities during session if set to true

  - ### lbs

    protected Map<String,AnB_Session> lbs
    Mapping agent identities and sessions

  - ### aliases

    protected Map<String,String> aliases
    Mapping agent aliases

- ## Constructor Details

  - ### AnB_Principal

    public AnB_Principal(Crypto_KeyStoreSettings_Map kssd, Map<String,Channel_Settings> cs, Map<String,String> aliases, Crypto_Config config)
    Constructor for AnB_Principal with specified key store settings, channel settings, aliases, and configuration.
    Parameters:
      `kssd` - Crypto key store settings map.
      `cs` - Map of channel settings.
      `aliases` - Map of aliases.
      `config` - Crypto configuration.

  - ### AnB_Principal

    public AnB_Principal(String myAlias, String path, Map<String,Channel_Settings> cs, Map<String,String> aliases, boolean needKeyStore, Crypto_Config config)
    Constructor for AnB_Principal with specified alias, path, channel settings, aliases, and configuration.
    Parameters:
      `myAlias` - Alias of the principal.
      `path` - Path for key store settings.
      `cs` - Map of channel settings.
      `aliases` - Map of aliases.
      `needKeyStore` - Flag that indicates need of creating keystore mappings.
      `config` - Crypto configuration.

  - ### AnB_Principal

    public AnB_Principal(String myAlias, String path, Map<String,Channel_Settings> cs, Map<String,String> aliases, boolean needKeyStore)
    Constructor for AnB_Principal with specified alias, path, channel settings, aliases, and needKeyStore.
    Parameters:
      `myAlias` - Alias of the principal.
      `path` - Path for key store settings.
      `cs` - Map of channel settings.
      `aliases` - Map of aliases.
      `needKeyStore` - Flag that indicates need of creating keystore mappings.

  - ### AnB_Principal

    public AnB_Principal(Crypto_KeyStoreSettings_Map kssd, Map<String,Channel_Settings> cs, Map<String,String> aliases)
    Constructor for AnB_Principal with specified key store settings, channel settings, and aliases.
    Parameters:
      `kssd` - Crypto key store settings map.
      `cs` - Map of channel settings.
      `aliases` - Map of aliases.

  - ### AnB_Principal

    public AnB_Principal(String myAlias, String path, Map<String,Channel_Settings> cs, Map<String,String> aliases)
    Constructor for AnB_Principal with specified alias, path, channel settings, and aliases.
    Parameters:
      `myAlias` - Alias of the principal.
      `path` - Path for key store settings.
      `cs` - Map of channel settings.
      `aliases` - Map of aliases.

- ## Method Details

  - ### init

    protected void init(Crypto_KeyStoreSettings_Map kssd, Map<String,Channel_Settings> cs, Crypto_Config config)
    Initialises AnB sessions based on provided key store settings, channel settings, and configuration.
    Parameters:
      `kssd` - Crypto key store settings map.
      `cs` - Map of channel settings.
      `config` - Crypto configuration.

  - ### init

    protected void init(String myAlias, Map<String,Channel_Settings> cs, Crypto_Config config)
    Initialises AnB sessions based on provided alias, channel settings, and configuration.
    Parameters:
      `myAlias` - Alias of the principal.
      `cs` - Map of channel settings.
      `config` - Crypto configuration.

  - ### run

    public <S extends Enum<?>, R extends Enum<?>> void run(AnB_Protocol<S,R> prot, long sessions)
    Runs the specified AnB protocol with a specified number of sessions.
    Type Parameters:
      `S` - Enum representing the protocol's steps.
      `R` - Enum representing the protocol's roles.
    Parameters:
      `prot` - AnB protocol to run.
      `sessions` - Number of sessions to run.

  - ### run

    public <S extends Enum<?>, R extends Enum<?>> void run(AnB_Protocol<S,R> prot)
    Runs the specified AnB protocol.
    Type Parameters:
      `S` - Enum representing the protocol's steps.
      `R` - Enum representing the protocol's roles.
    Parameters:
      `prot` - AnB protocol to run.