Crescendo SDK
Loading...
Searching...
No Matches
Using the SDK

SDK Structure

The API is natively built upon .NET 6.0 (and works without issues on all higher .NET versions). The CLI Tool is built on top of the API, directly calling the API functions. You can therefore use the CLI Tool without any additional work, or directly call the API methods from other applications using C# or Python.

SDK structure

API Structure

The API is designed to be relatively straightforward to use. It contains one main namespace called CrescendoDLL. Inside the CrescendoDLL namespace there is one main class called SDKCore. All the functionality of the API if performed on an instance of the SDKCore class.

After an instance of the SDKCore class was created, user has the option to set the desired Log level (and when working with C# directly, also a specific logging function).

When working with C# directly, user also needs to specify his own function for PIN and XAUTH retrieval using the SetPINDialog and SetXAUTHDialog respectively.

Initial Set-up

Command Line Tool

No need for initial set-up, the Command Line Tool is ready to be used without any prerequisites.

C#

  • Add a reference to the CrescendoDLL.dll file into your existing project.
  • (Optional) Set the desired log level by using the SetLogLevel function and the values from LogLevel. The default value is LogLevel.SILENT.
  • (Optional) Set the log function of your choice by using the SetLogAction function. The default value is Console.Error.WriteLine, to separate the actual output (STDOUT) from the logging data (STDERR).
  • Create an instance of the main class SDKCore with the token of your choice.
  • Set a method to provide the PIN or XAUTH by using the SetPINDialog or SetXAUTHDialog respectively.

Code Example:

// LOG data should go to STDERR
SDKCore.SetLogAction(Console.Error.WriteLine);
SDKCore transaction = new("Circle Idaxis SecurePIV 0");
transaction.SetPINDialog((pinType) =>
{
//Code to provide a string "pin"
return pin;
});
transaction.SetXAUTHDialog((xauthType) =>
{
//Code to provide a string "xauth"
return xauth;
});
The SDKCore class contains all fundamental methods that can be used by the user to communicate with t...
Definition Methods.cs:41
void SetXAUTHDialog(Func< SecretType, string > userDialog)
Sets the method to gather the XAUTH from the user.
Definition Methods.cs:400
void SetPINDialog(Func< SecretType, string > userDialog)
Sets the method to gather the PIN from the user.
Definition Methods.cs:379
static void SetLogLevel(LogLevel severity)
Sets the severity level for logging.
Definition Methods.cs:510
static void SetLogAction(LogActionDelegate logAction)
Sets the action to be performed when a log message is generated.
Definition Methods.cs:501
The CrescendoDLL namespace contains classes and methods that allow the user to perform various operat...
Definition Cryptography.cs:12
LogLevel
Enum LogLevel for representing different levels of logging.
Definition Log.cs:65

Python

  • Download and Install Python 3.10 or newer from the official website.
  • Install the pythonnet package by running the command pip install pythonnet from the folder where your instance of Python.exe is located.
  • Load the correct .NET core clr coreclr and import it.
  • Import the main API file - CrescendoDLL.dll
  • Import the SDKCore class.
  • (Optional) Import the LogLevel Enum and set the desired Log level by using the SetLogLevel function and the values from LogLevel. The default value is LogLevel.SILENT.
  • Create an instance of the main class SDKCore with the token of your choice.
  • Set PIN or XAUTH by using the SetPINForPythonWrapper or SetXAUTHForPythonWrapper respectively.

Code Example:

from pythonnet import load
load("coreclr")
import clr
# Import the main DLL.
clr.AddReference(r'c:\Temp\CrescendoDLL.dll')
from CrescendoDLL import SDKCore
from CrescendoDLL import LogLevel
SDKCore.SetLogLevel(LogLevel.INFO)
# Create an instance of the base class with chosen token
dllMethodsInstance = SDKCore('Circle Idaxis SecurePIV 0')
# Call the SetPINForPythonWrapper method
dllMethodsInstance.SetPINForPythonWrapper('123456')