Package anbxj
Class AnB_Principal
java.lang.Object
anbxj.AnB_Principal
- Direct Known Subclasses:
AnBx_Principal
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
FieldsModifier and TypeFieldDescriptionMapping agent aliasesprotected boolean
Flag to automatically exchange identities during session if set to trueprotected Map
<String, AnB_Session> Mapping agent identities and sessions -
Constructor Summary
ConstructorsConstructorDescriptionAnB_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, Crypto_Config config) Constructor for AnB_Principal with specified alias, path, channel settings, aliases, and configuration. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
init
(Crypto_KeyStoreSettings_Map kssd, Map<String, Channel_Settings> cs, Crypto_Config config) Initializes AnB sessions based on provided key store settings, channel settings, and configuration.run
(AnB_Protocol<S, R> prot) Runs the specified AnB protocol.run
(AnB_Protocol<S, R> prot, long sessions) Runs the specified AnB protocol with a specified number of sessions.
-
Field Details
-
exchange_identities
protected boolean exchange_identitiesFlag to automatically exchange identities during session if set to true -
lbs
Mapping agent identities and sessions -
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, 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.config
- Crypto configuration.
-
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) Initializes 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.
-
run
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
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.
-