Setup
To use the FM SDK for building FMs or Host applications, you must install both the SafeNet ProtectToolkit FM SDK and SafeNet ProtectToolkit-C SDK software on your development workstation. On Linux, you must also install the FM toolchain.
NOTE You cannot install the SafeNet ProtectToolkit runtime and FM SDK on the same workstation. It is recommended that you do your FM development on a separate workstation.
For details regarding the installation or uninstallation of the software discussed in this manual, please refer to the SafeNet ProtectToolkit-C Administration Guide.
Installing the FM SDK
All of the software required to install and configure the FM SDK can be downloaded from the Gemalto eService Support Portal at https://serviceportal.safenet-inc.com.
Before you use the FM SDK, you must configure your environment, as described in Environment Variables.
Windows
To install the FM SDK on Windows, you must install the SafeNet ProtectToolkit FM SDK and SafeNet ProtectToolkit-C SDK software. Before using the FM SDK, you must run a script to configure your environment, as described in Environment Variables.
To install the FM SDK software:
1.Log in to the computer as the Administrative user.
2.Install the SafeNet ProtectToolkit-C software, as described in the SafeNet ProtectToolkit-C Administration Guide.
3.Go to the folder for your architecture in the installer directory:
64-bit: cd <path to directory>\SDKs\Win64
32-bit: cd <path to directory>\SDKs\Win32
4.Run the following .msi file to install the SafeNet ProtectToolkit FM SDK software:
fm_sdk\PTKfmsdk.msi
To configure your FM SDK environment:
Linux
To install the FM SDK on Linux, you must install the SafeNet ProtectToolkit FM SDK and SafeNet ProtectToolkit-C SDK software. Before using the FM SDK, you must run a script to configure your environment. You can add the script to your startup file (for example, .bashrc) to have it set up the environment each time you open a shell, or you can source the script each time you open a shell that you will use for FM development. See Environment Variables.
To install the FM SDK software:
1.Log in to the computer as the Administrative user.
2.Install the SafeNet ProtectToolkit-C software, as described in the SafeNet ProtectToolkit-C Administration Guide.
3.Go to the folder for your architecture in the installer directory:
64-bit: cd <path to directory>\SDKs\Linux64
32-bit: cd <path to directory>\SDKs\Linux
4.Install the RPM file for your architecture to install the SafeNet ProtectToolkit FM SDK software:
64-bit: ptkc_sdk/PTKfmsdk-<release>.x86_64.rpm
32-bit: ptkc_sdk/PTKfmsdk-<release>.x86.rpm
To configure your FM SDK environment:
Environment Variables
FM developers should ensure that their development environment is configured correctly and that all required files and library locations are set. This chapter is provided as a guideline for setting up the development environment so that required files can be accessed during the FM compile and link routines.
In order to be able to use the build scripts, the following environment variables are used:
>CPROVDIR: Specifies the installed location of the Cprov SDK (SafeNet ProtectToolkit-C)
>FMDIR: Specifies the installed location of the FM SDK
Setting the Environment Variables
The environment variables are set using scripts.
To set the environment variables on Linux:
1.Go to the SafeNet ProtectToolkit software installation directory:
cd /opt/safenet/protecttoolkit5/ptk
2.Source the setvars.sh script:
/setvars.sh
To set the environment variables on Windows:
1.Go to the SafeNet ProtectToolkit FM SDK software installation directory:
cd <fmsdk_install_dir>\bin
2.Run the fmsdkvars.bat script:
/fmsdkvars.bat
Windows Environment Variable Paths
Please note that the Windows build scripts cannot handle space (“ ”) characters in the environment variables mentioned above. If the paths to the install locations contain a space in the directory name (e.g. C:\Program Files\SafeNet\Cprov SDK), you should use the short names of the directories that contain spaces (e.g. C:\Progra~1\SafeNet\CprovS~1). The short format of the directory names can be discovered using the ‘/x’ switch in a dir command. For example, you can use dir /x c:\progra* command to discover the short name of the “Program Files” directory.
NOTE If you are using the provided FM SDK fmsdkvars.bat script, the paths are already converted to their short form.