extranetcontact ussitemaphome  
DigitalNet
        Home > Knowledge Bank > SMP













   

 

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.  

  1. Download the contents of the tar'd and gzip'd distribution file containing the source code for the ESNACC C++ library. 

  2. 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).

  3. 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


Building on Windows using Visual C++® 6.0

  1. Extract the contents of the downloaded distribution files (using WinZip® or similar utility).

  2. After extracting rijndaelref.zip, copy all of the files found in the ref22 directory to the smp/SMIME/libCtilMgr/AES directory.

  3. Open the snacc_builds.dsw workspace.

  4. Build the "BuildAll" project.

  5. Close the snacc_builds workspace and open the smp.dsw workspace.

  6. If not using the Storage and Retrieval Library, remove the srl project from the BuildAll files project.

  7. Build the "BuildAll" project.

Building on Windows using Visual C++® .NET 2003

  1. Extract the contents of the downloaded distribution files (using WinZip® or similar utility).

  2. After extracting rijndaelref.zip, copy all of the files found in the ref22 directory to the smp/SMIME/libCtilMgr/AES directory.

  3. Open the snacc_builds.dsw workspace.

  4. Open the snacc_builds.sln solution.

  5. Build the "BuildAll" project.

  6. Close the snacc_builds solution and open the smp.sln solution.

  7. If not using the Storage and Retrieval Library, remove the srl project from the BuildAll files project.

  8. Build the "BuildAll" project.

Building on UNIX

  1. Unpack the ESNACC distribution:
       tar xfz esnacc-1.7.tgz
    cd SNACC
  2. 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]

  3. Build the libraries by typing:
       make

  4. Install the libraries by typing:
       make install

  5. Test the SNACC libraries by typing:
       make check
  6. Unpack the SMP distribution:
       tar xfz smp_v2.4.tgz

  7. Unpack the AES distribution and copy the source code:
       unzip rijndaelref.zip
       cp ref22/* smp/SMIME/libCtilMgr/AES/.
       cd smp

  8. List the available SMP configuration options by typing:
       ./configure --help

  9. 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]

  10. Build the libraries by typing:
       make

  11. Install the libraries by typing:
       make install

  12. 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.


Configuration Items

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
  • This option will set the default SMPDist directory. The SMPDist directory is used by the configure/make process as a staging directory for the install process and as an internal library and include directory storage ares for the SMP. The default SMPDist directory will be one directory level up from your SMP directory. The SMPDist directory MUST be structured to resemble /usr/local (must have subdirectories lib, and include) These directories will be created if they don't exist.
    Example: --with-smpdistdir=/home/homer/smp/SMPDist
Option:
  --with-bsafedir
  Associated Environment variable: BSAFEDIR
  • The --with-bsafedir will set the default Bsafe directory to the directory specified instead of /usr/local/lib and /usr/local/include.
    Example: --with-bsafedir=/usr/foo/bsafe
Option:
  --with-cryptoppdir
  Associated Environment variable: CRYPTOPPDIR
  • This option will set the default Crypto++ directory to the directory specified instead of the default /usr/local/lib and /usr/local/include/cryptopp.
    Example: --with-cryptoppdir=/usr/foo/Cryptopp
Option:
  --with-fortezzadir
  Associated Environment variable: FORTEZZADIR
  • This option will set the default Fortezza directory to the directory specified instead of /usr/local/lib and /usr/local/include.
    Example: --with-fortezzadir=/usr/foo/Fort
Option:
  --with-snaccdir
  Associated Environment variable: SNACCDIR
  • The --with-snaccdirexec will set the default SNACC library and include directory root (the default is /usr/local).
    Example: --with_snaccdir=/home/george/snacc
Option:
  --with-snaccdirexec
  Associated Environment variable: SNACCDIREXEC
  • The --with-snaccdirexec will set the default SNACC executable to the executable passed in (the default is /usr/local/bin/snacc).
    Example: --with_snaccdirexec=/home/george/bin/snacc
Option:
  --prefix
  Associated Environment variable: None
  • This option is used to specify a different install directory other than the default (/usr/local). This option is used to place the include files in [prefix]/include/smp and the library files in [prefix]/lib.
    Example: --prefix=/home/george/application

copyrightprivacy policy