Creating CCM Application in C++

The C++ related CCM directories contain specific sets of files:

  • The <DISK>/SDK/API/CCM/cpp/bin directory contains standard .dll files that must be linked into the C++ application for either x86win32 or x64win32 platforms with Unicode Character Set.

  • The <DISK>/SDK/API/CCM/cpp/include directory contains the CCM header files.

  • The <DISK>/SDK/API/CCM/cpp/lib directory contains the CCM static libraries.

Contents of C++-Related CCM Directories

Directory

Contents

SDK\API\CCM\cpp\bin\x64win32\

  • acjnicoe.dll

  • aclogu64.dll

  • ai-ccm-apiU.dll

  • ai-cms-ccm-credU.dll

  • ai-cms-ccm-securitymoduleU.dll

  • ai-cms-ccm-syncU.dll

  • ai-cms-ccm-userU.dll

  • ai-cms-ccm-walletU.dll

  • ai-cms-ccmU.dll

  • ai-coe-bsiU.dll

  • ai-coe-msvscardU.dll

  • ai-coe-pkcs11U.dll

  • ai-interfacesU.dll

  • ai-localizationU.dll

  • aiCCMStatusMessages.ini

  • CredentialManagerU.ini

  • msvcp140.dll

  • SecurityModuleManagerU.ini

  • SyncManagerU.ini

  • UserManagerU.ini

  • vcruntime140.dll

  • WalletManagerU.ini

SDK\API\CCM\cpp\bin\x86win32\

  • acjnicoe.dll

  • aclogu.dll

  • ai-ccm-apiU.dll

  • ai-cms-ccm-credU.dll

  • ai-cms-ccm-securitymoduleU.dll

  • ai-cms-ccm-syncU.dll

  • ai-cms-ccm-userU.dll

  • ai-cms-ccm-walletU.dll

  • ai-cms-ccmU.dll

  • ai-coe-bsiU.dll

  • ai-coe-msvscardU.dll

  • ai-coe-pkcs11U.dll

  • ai-interfacesU.dll

  • ai-localizationU.dll

  • aiCCMStatusMessages.ini

  • CredentialManagerU.ini

  • msvcp140.dll

  • SecurityModuleManagerU.ini

  • SyncManagerU.ini

  • UserManagerU.ini

  • vcruntime140.dll

  • WalletManagerU.ini

SDK\API\CCM\cpp\include

  • aiCCMConstants.h

  • aiCCMCred.h

  • aiCCMCredentialManagerImpl.h

  • aiCCMErrorCodes.h

  • aiCCMErrorMessages.h

  • aiCCMSecurityModuleManagerImpl.h

  • aiCCMSmo.h

  • aiCCMSyncManagerImpl.h

  • aiCCMTcd.h

  • aiCCMUser.h

  • aiCCMUserManagerImpl.h

  • aiCCMUtil.h

  • aiCCMUtilImpl.h

  • aiCCMWallet.h

  • aiCCMWalletManagerImpl.h

  • aiClientOperationExecutor.h

  • aiCOEConstants.h

  • aiCOEScriptContentMgmt.h

  • aiDllUtil.h

  • aiInterfaces.h

  • aiLocalization.h

  • aiTString.h

  • aiVector.h

SDK\API\CCM\cpp\lib\x64win32

  • ai-ccm-apiU.lib

  • ai-cms-ccm-credU.lib

  • ai-cms-ccm-securitymoduleU.lib

  • ai-cms-ccm-syncU.lib

  • ai-cms-ccm-userU.lib

  • ai-cms-ccm-walletU.lib

  • ai-cms-ccmU.lib

  • ai-interfacesU.lib

  • ai-localizationU.lib

SDK\API\CCM\cpp\lib\x86win32

  • ai-ccm-apiU.lib

  • ai-cms-ccm-credU.lib

  • ai-cms-ccm-securitymoduleU.lib

  • ai-cms-ccm-syncU.lib

  • ai-cms-ccm-userU.lib

  • ai-cms-ccm-walletU.lib

  • ai-cms-ccmU.lib

  • ai-interfacesU.lib

  • ai-localizationU.lib

Required Libraries and Files

In the Microsoft runtime environment, the MS-Visual Studio 2022 runtime library is also required:

The <DISK>/SDK/API/CCM/cpp/sample directory contains sample code and an initial project for testing the sample code.

The testCCM.cpp sample application in the sample directory implements several functions like a typical CCM API based-application would, which includes the following:

  • Device issuance (binding, action submission, synchronization, and activation)

  • Device recycle (returning a device to a blank state by unbinding, action submission, and synchronization)

  • Card unlock and PIN unlock

  • Clearance of pending/failed device production requests

  • User creation

Compile Settings

The compile settings include the following requirements:

  • CCM applications that are created using C++ must be built using either the multi-threaded DLL or multi-threaded Debug DLL option.

  • To comply with the default configuration of Visual Studio 2022, the Yes (native wchar) configuration is used.

  • The Character Set must be set to Use Unicode Character Set

 

Memory Management Guidelines for C++ CCM API Applications

Note: Make sure that you allocate and deallocate memory consistently. You should create all client-side memory objects using new and release them using delete.

It is important to establish and adhere to a set of well-defined rules for memory management in the CCM API. Particularly with C/C++, memory management is an extremely important consideration. If there are resources being unwisely consumed or if you encounter memory leaks, this may cause errors to occur and performance may be impacted. You can prevent these potential conditions by observing the following rules:

  • Any memory object that is created by the calling application (client) and passed to the CCM API must also be released by the client.

  • Any memory object that is returned by the CCM API must also be released by the client.

  • Avoid the C-style memory functions malloc and free and all of their variants.

  • Always use factories to instantiate managers; never call the constructors directly.