|
Building the Library
The CM library consists of four separate libraries:
- cmapi, the main CM library,
- crlapi, the certificate revocation list server library (optional),
- srlapi, the Storage and Retrieval library (optional)
- cmlasn, the CML ASN.1 library for encoding and decoding X.509 certificates and other ASN.1-encoded objects.
In addition to those four libraries, the CML calls functions in a PKCS #11 library (i.e., Cryptoki) or Microsoft's CAPI library (only on Windows) to perform the required cryptographic functions. The CML also requires the ESNACC C++ ASN.1 library in order to encode and decode ASN.1 objects. These libraries and their header files must be present in order to build any one of the CML libraries.
- Download the contents of the tar'd and gzip'd distribution file containing the source code for the ESNACC C++ library.
- Download the tar'd and gzip'd distribution file containing the source code for the Secure Message Protocol (SMP) v2.4 libraries (including the CML).
- Download the zip'd distribution file containing the source code for the reference implementation of the Advanced Encryption Standard (AES) algorithm.
Building on Windows using Visual C++® 6.0
Building on Windows using Visual C++® .NET 2003
Building on UNIX
- Extract the contents of the downloaded distribution files (using WinZip® or similar utility).
- After extracting rijndaelref.zip, copy all of the files found in the ref22 directory to the smp/SMIME/libCtilMgr/AES directory.
- Open the snacc_builds.dsw workspace.
- Build the "BuildAll" project.
- Close the snacc_builds workspace and open the smp.dsw workspace.
- If not using the Storage and Retrieval Library, remove the srl project from the BuildAll files project.
- Build the "BuildAll" project.
- Extract the contents of the downloaded distribution files (using WinZip® or similar utility).
- After extracting rijndaelref.zip, copy all of the files found in the ref22 directory to the smp/SMIME/libCtilMgr/AES directory.
- Open the snacc_builds.dsw workspace.
- Open the snacc_builds.sln solution.
- Build the "BuildAll" project.
- Close the snacc_builds solution and open the smp.sln solution.
- If not using the Storage and Retrieval Library, remove the srl project from the BuildAll files project.
- Build the "BuildAll" project.
- Unpack the ESNACC distribution:
tar xfz esnacc-1.7.tgz cd SNACC
- Run the configure script to automatically detect the appropriate settings and produce the makefiles for the SNACC libraries. You may need to specify options and/or environment variables to the configure script to obtain the desired results for your particular environment. SNACC has no special options defined.
To build debug libraries, use the --enable-debug option which will append an "_d" to the library name. The configure script is run by typing:
[environment settings] ./configure [options]
- Build the libraries by typing:
make
- Install the libraries by typing:
make install
- Test the SNACC libraries by typing:
make check
- Unpack the SMP distribution:
tar xfz smp_v2.4.tgz
- Unpack the AES distribution and copy the source code:
unzip rijndaelref.zip
cp ref22/* smp/SMIME/libCtilMgr/AES/.
cd smp
- List the available SMP configuration options by typing:
./configure --help
- Run the configure script to automatically detect the appropriate settings and produce the makefiles for the SMP libraries. You may need to specify options and/or environment variables to the configure script to obtain the desired results for your particular environment. The configure script is run by typing:
[environment settings] ./configure [options]
- Build the libraries by typing:
make
- Install the libraries by typing:
make install
- Test the SMP libraries by typing:
make check
UNIX Notes:
Installation Names
By default, `make install' will install the SMP libraries and include files in /usr/local/lib and /usr/local/include. The SMP include files will be stored in /usr/local/include/smp and the SMP ASN.1 modules will be stored in /usr/local/include/Modules. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. The installation directory MUST be structured as a normal install directory would be. It MUST contain a bin, lib, and include subdirectories, such as /usr/local.
Post Installation
Under a normal configuration all SMP libraries are installed into the /usr/local/lib directory, and all include files are installed into /usr/local/include/smp. If the default directories were not used in your build and install process, you may need to set your LD_LIBRARY_PATH to the directories you specified. If default include locations were not used, you may have to add the "-I" option to your compilation line in order for the compiler to find the proper include files. To reference a SMP include file you will need to add the -I option to your compilation line. By default it would look like "-I/usr/local/include/smp"
By default, all SMP shared and static libraries will be stored in /usr/local lib. Some UNIX systems have /usr/lib and /usr/local/lib as their default LD_LIBRARY_PATH environment settings. If your system settings do not include the SMP library path in LD_LIBRARY_PATH, then you will have to add this in order for the shared libraries to link and your executables to run properly.
The SMP configure process allows you to specify different configuration options, in order to build the SMP libraries properly. The configuration options can either be passed to configure as an option (--enable, --with) or via environment variables set before the configure shell is started. The options recognized by the SMP configure process are:
Option:
--enable-debug
Associated Environment variable: None
- This option enables debug libraries to be built. These libraries will be named with a "_d" appended to the name to denote a debug library. For example, the non-debug SRL library is called libsrlapi.so and the debug library is called libsrlapi_d.so.
Option:
--disable-threads
--enable-threads=no
Associated Environment variable: None
- This option disables threads when compiling the SMP libraries. By default, threads are enabled. Note: disabling threads on a operating system that supports threads will make the code thread unsafe.
Option:
--with-smpdistdir
Associated Environment variable: SMPDISTDIR
Option:
--with-bsafedir
Associated Environment variable: BSAFEDIR
Option:
--with-cryptoppdir
Associated Environment variable: CRYPTOPPDIR
Option:
--with-fortezzadir
Associated Environment variable: FORTEZZADIR
Option:
--with-snaccdir
Associated Environment variable: SNACCDIR
Option:
--with-snaccdirexec
Associated Environment variable: SNACCDIREXEC
Option:
--prefix
Associated Environment variable: None
|