gecko-dev/security/jss/jss.html
2004-04-25 15:03:26 +00:00

101 lines
4.6 KiB
HTML

<html>
<!-- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
- The contents of this file are subject to the Mozilla Public License Version
- 1.1 (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS" basis,
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- for the specific language governing rights and limitations under the
- License.
-
- The Original Code is the Netscape Security Services for Java.
-
- The Initial Developer of the Original Code is
- Netscape Communications Corporation.
- Portions created by the Initial Developer are Copyright (C) 1998-2000
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the GPL or the LGPL. If you do not delete
- the provisions above, a recipient may use your version of this file under
- the terms of any one of the MPL, the GPL or the LGPL.
-
- ***** END LICENSE BLOCK ***** -->
<head>
<title>Netscape Security Services for Java</title>
</head>
<body bgcolor="white" text="black">
<!--font face="sans-serif"-->
<center><h1>Netscape Security Services for Java</h1></center>
Netscape Security Services for Java (JSS) is an interface allowing Java applications
to use the Secure Sockets Layer protocol. The interface is implemented with the
FIPS-validated Netscape Security Services library.
It consists of a system-dependent dynamic library (<code>libjss.so</code>
on UNIX, <code>jss.dll</code> on Windows) and a ZIP file
(<code>jss.zip</code>) containing system-independent Java classes.
These classes are compatible with JDK 1.1 or later <b>using the native
thread implementation (not green threads)</b>.
<h2>Building Applications with JSS</h2>
To construct Java applications that use JSS, you must:
<ul>
<li>Call the JSS classes from your application.
<li>When compiling your application, put <code>jss.zip</code> in your
<code>CLASSPATH</code>.
<li>When running your application, put <code>libjss.so</code> in your
<code>LD_LIBRARY_PATH</code> (on UNIX) or <code>jss.dll</code>
in your <code>PATH</code> (on Windows), and put
<code>jss.zip</code> in your <code>CLASSPATH</code>.
</ul>
<h2>Programming with JSS</h2>
Before the SSL classes can be used,
<a href="javadoc/org/mozilla/jss/NSSInit.html#initialize(java.lang.String, java.lang.String, java.lang.String)">
<code>NSSInit.initialize</code></a> must be called to open the security
databases and initialize the random number generator.
<a href="javadoc/org/mozilla/jss/NSSInit.html#setPasswordCallback(org.mozilla.jss.util.PasswordCallback)"><code>
NSSInit.setPasswordCallback</code></a> may be called to change the password
callback; the default is to prompt for passwords on the command line.
<p>The files in the <code>examples</code> directory illustrate the use of JSS
in an application:
<dl>
<dt><a href="examples/SSLClient.java">SSLClient.java</a>
<dd>An example of an SSL client application.
<dt><a href="examples/SSLServer.java">SSLServer.java</a>
<dd>An example of an SSL server application.
To run, it requires certificate
and key databases that contain a certificate called "SSLServer". The sample
<code>cert7.db</code> and <code>key3.db</code> files, also in the
<code>examples</code> directory,
can be used for this purpose. When <code>SSLServer</code> is run,
it will ask for a password
for the "Internal Key Storage Token", which is the key database.
The password for the example <code>key3.db</code> file is "netscape".
</dl>
These classes are in the <code>org.mozilla.jss.ssl</code> package.
The <code>.class</code> files must be put in the subdirectory
<code>org/mozilla/jss/ssl</code> of a <code>CLASSPATH</code> entry
in order to be located by the Java virtual machine.
<a href="javadoc/index.html"><h2>Javadoc for the JSS Classes</h2></a>
<!--/font-->
</body>
</html>