Package anbxj
Class AnB_Session
java.lang.Object
anbxj.AnB_Crypto_Wrapper
anbxj.AnB_Session
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
ConstructorsConstructorDescriptionAnB_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. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Close()
Closes the session by closing the channel and logging the closure.Gets the current channel.Gets the remote identity (AnBx_Agent).void
Open()
Opens the session by initiating the channel, exchanging IDs if required.Receive()
Receives an object using the current channel.Receives the remote identity (AnBx_Agent) using the current channel.void
Sends an object using the current channel.void
Send_Id()
Sends the local identity (me) using the current channel.void
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, getSymmetricKeyPBE, getTimeStamp, isLoggingExecTimeEnabled, makeDigest, makeHmac, readObject, Receive, Receive_RemoteId, Send, Send_Id, setLoggingExecTimeEnabled, setMyIdentity, Setup, Setup, sign, sign, sign, verify, verify, verify, writeObject, xor
-
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
Receives an object using the current channel.- Returns:
- The received object.
-
Send
Sends an object using the current channel.- Parameters:
obj
- The object to be sent.
-
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
Gets the current channel.- Returns:
- The current channel.
-
getId_Remote
Gets the remote identity (AnBx_Agent).- Returns:
- The remote identity.
-
setChannel
Sets the current channel.- Parameters:
c
- The channel to be set.
-
setId_Remote
Sets the remote identity (AnBx_Agent).- Parameters:
id_Remote
- The remote identity to be set.
-