Creating and Disposing of Sessions
- Updated2025-08-04
- 1 minute(s) read
To interact with the ATECCGEN2 rack, you must create an IAteCoreSession object using the static function CreateAteCoreSessionAsync from AteCoreSession. This static function takes in the following arguments to connect to a rack from a host:
- Hostname/IP address
- Password
- Optional rememberPassword parameter
When the session object is returned from CreateAteCoreSessionAsync, the network connection is successfully established and you can use the session to call the properties and functions of different classes and interfaces to perform the desired operation. Call Dispose to close the network connection.
Session Creation and Session Disposal
IAteCoreSession ateCoreSession = null;
try
{
// To create an object of IAteCoreSession.
ateCoreSession = await AteCoreSession.CreateAteCoreSessionAsync(hostname, password, true);
// Call another function to perform an operation on the ATECCGEN2 rack.
}
catch(Exception ex)
{
Console.WriteLine(ex.Message); //Print the exception message.
}
finally
{
if (ateCoreSession != null)
{
// To close the session.
ateCoreSession.Dispose();
}
}
Related Information
- Credential Management
The remote communication channel between a host and the RCU is encrypted using TLS. Each ATECCGEN2 rack has a default private key and a public certificate. To communicate with the rack the host must have the TLS public certificate, which can be obtained from the RCU via FTP service. The RCU is also password protected, meaning a password is required for communication via API. Each rack has a unique default password, which you should change for security purposes.