If you have already built JSS, or if you are planning to use a binary release of JSS, here’s how to get JSS working with your code.
You need the JSS classes and the NSPR, NSS, and JSS shared libraries.
NSPR and NSS Shared Libraries
JSS uses the NSPR and NSS libraries for I/O and crypto. JSS version 3.0 linked statically with NSS, so it only required NSPR. JSS versions 3.1 and later link dynamically with NSS, so they also require the NSS shared libraries.
The exact library names vary according to the convention for each platform. For example, the NSPR library is called
libnspr4.dllon Windows and
libnspr4.soon Solaris. The following table gives the core names of the libraries, omitting the platform-specific prefix and suffix.
Core Library Name
Binary Release Location
NSPR OS abstraction layer
NSPR standard C library replacement functions
NSPR data structure types
NSS crypto, PKCS #11, and utilities
NSS SSL library
NSS S/MIME functions and types
PKCS #11 module containing built-in root CA certificates. Optional.
Processor-specific optimized big-number arithmetic library. Not present on all platforms. mozilla_projects_nss_introd uction_to_network_security_services
FORTEZZA support. Optional
PKCS #11 module implementing FORTEZZA in software. Optional.
If you built JSS from source, you have these libraries in the
mozilla/dist/<platform>/libdirectory of your build tree. If you are downloading binaries, get them from the binary release locations in the above table. You need to select the right version of the components, based on the version of JSS you are using. Generally, it is safe to use a later version of a component than what JSS was tested with. For example, although JSS 4.2 was tested with NSS 3.11.
3.6.1 or 3.7
4.2 or 4.1.2
JSS Shared Library
The JSS shared library is
libjss4.so(Unix). If you built JSS from source, it is in
mozilla/dist/<platform>/lib. If you are downloading binaries, get it from http://ftp.mozilla.org/pub/mozilla.org/security/jss/releases/.
If you built JSS from source, the compiled JSS classes are in
mozilla/dist/classes[_dbg]. You can put this directory in your classpath to run applications locally; or, you can package the class files into a JAR file for easier distribution:
cd mozilla/dist/classes[_dbg] zip -r ../jss42.jar .
If you are downloading binaries, get jss42.jar from http://ftp.mozilla.org/pub/mozilla.org/security/jss/releases/.
You need to set some environment variables before building and running Java applications with JSS.
Include the path containing the JSS classes you built, or the path to
jss42.jar. (The path to
jss34.jarends with the string “/jss42.jar”. It is not just the directory that contains
Include the path to the NSPR, NSS, and JSS shared libraries.