demo.keystore
Class KeyStoreDemo

java.lang.Object
  |
  +--demo.keystore.KeyStoreDemo

public class KeyStoreDemo
extends Object

This demo shows the usage of a JCA compliant keystore. Keys and certificates used for this demo are read from the IAIK-JCE sample keystore ("jce.keystore") file which may be created by running the SetupKeyStore program. The jce.keystore file has to be located in your current working directory.

Version:
File Revision 4

Constructor Summary
KeyStoreDemo()
          Default constructor.
 
Method Summary
 void createKeyStore(char[] password, OutputStream os)
          Creates a new IAIK keystore, adds two entries and writes the keystore to the given output stream.
static void main(String[] argv)
          Main method.
 void readKeyStore(char[] password, InputStream is)
          Reads the demo keystore from the given stream and parses its content.
 void start()
          Starts the demo.
 void start(String fileName)
          Starts the demo.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyStoreDemo

public KeyStoreDemo()
Default constructor.
Method Detail

createKeyStore

public void createKeyStore(char[] password,
                           OutputStream os)
                    throws Exception
Creates a new IAIK keystore, adds two entries and writes the keystore to the given output stream.
Parameters:
password - the (keystore and key entry) password
os - the stream to which to write the keystore just created
Throws:
Exception - if some error occurs

readKeyStore

public void readKeyStore(char[] password,
                         InputStream is)
                  throws Exception
Reads the demo keystore from the given stream and parses its content.
Parameters:
password - the (keystore and key entry) password
is - the stream from which to read the demo keystore
Throws:
Exception - if an error occurs while reading/parsing the keystore

start

public void start()
Starts the demo.

start

public void start(String fileName)
Starts the demo.
Parameters:
fileName - the name of the file to which to write (and then from where to read) the demo keystore; if null ByteArrayStreams are used

main

public static void main(String[] argv)
Main method.

This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note).

IAIK-JCE 3.1 with IAIK-JCE CC Core 3.1, (c) 1997-2004 IAIK