Guardtime KSI c SDK
Guardtime KSI c SDK Documentation

The SDK

The SDK provides the following functionality:

KSI Context

The KSI context KSI_CTX is the central object. It contains configuration, logging support, error stack traces and more. The context makes it possible to use the SDK safely in a multi-threaded application. The context may not be freed before all objects created using this context are freed.

Every thread using the SDK must own at least one instance of KSI_CTX, but the number is not limited. In order to maintain thread safety one context may not be shared between contexts. Using multiple contexts however limits the scope where all the KSI object may be used.

All objects originating from one context should not be mixed with objects from an other context. The context is created using KSI_CTX_new which will create a new instance. The instance can be freed using KSI_CTX_free after all objects created using this context are freed.

Memory Management

The memory management obeys the following rules:

Logging

The logging mechanism is based on a single callback function with three parameters (see KSI_LoggerCallback). A simple logging function KSI_LOG_StreamLogger is included in the SDK, where the logCtx is meant to be a FILE pointer to the output stream (may also be stdout or stderr). The stream has to be closed externally.

The callback is set with the KSI_CTX_setLoggerCallback function. The log level can be changed using KSI_CTX_setLogLevel. The default logger is turned of and the output will be written to stdout, if the log level is changed to something other than KSI_LOG_NONE (e.g KSI_LOG_DEBUG). For more information on log levels see KSI_LOG_LVL_en.

Troubleshooting

There are several ways to troubleshoot problems related to the SDK.

Dependencies

The SDK is using the following third party components:

Acknowledgments

This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (www.openssl.org).

This product includes cryptographic software written by Eric Young (eay@c.nosp@m.rypt.nosp@m.soft..nosp@m.com). This product includes software written by Tim Hudson (tjh@c.nosp@m.rypt.nosp@m.soft..nosp@m.com).

This product includes networking software developed by the cURL Project (curl.haxx.se).