The HLAPI implements the AMT Authenticate feature in the AMT Authenticate API.
The available methods are described in the IAuthenticate interface.
Examples
These C# examples show how to use the AMT Authenticate API (after connecting to the Intel AMT device).
Examples using the AMT Authenticate API:
Basic Usage with JSON Configuration
using System;
using Intel.Manageability;
using Intel.Manageability.Exceptions;
using HLAPI.AmtAuthenticate;
class AmtAuthenticateExample
{
static void Main(string[] args)
{
IAMTInstance amt = null;
ConnectionInfoEX connectionInfo = null;
try
{
// Load connection info from JSON file
connectionInfo = ProgramInput.DeserializeJsonToStruct(args.Length > 0 ? args[0] : null);
// Create the AMT instance
amt = AMTInstanceFactory.CreateEX(connectionInfo);
}
catch (ManageabilityException e)
{
connectionInfo?.Dispose();
Console.WriteLine($"Connection failed: {e.Message}");
return;
}
try
{
// For production platforms, use debug = false (default)
// For pre-production platforms, use debug = true to allow debug certificates
bool allowDebugCert = false;
// Using the static helper method
AmtAuthenticateFunctionality.Authenticate(amt, allowDebugCert);
}
catch (AuthenticatorException ex)
{
Console.WriteLine($"Authentication error: {ex.Message}");
Console.WriteLine($"Failure status: {ex.FailureCode}");
}
catch (Exception ex)
{
Console.WriteLine($"Unexpected error: {ex.Message}");
}
finally
{
amt?.Dispose();
}
}
}