edu.nyu.cs.pdsg.util
Class KeyDirectory

java.lang.Object
  extended byedu.nyu.cs.pdsg.util.KeyDirectory

public class KeyDirectory
extends java.lang.Object

KeyDirectory is a temporary hack which will allow us to provide public and private keys.

You must call KeyDirectory.init() before using any of it's functions


Field Summary
private static boolean initialized
           
private static KeyDirectoryInterface privateDir
           
private static KeyDirectoryInterface publicDir
           
 
Constructor Summary
KeyDirectory()
           
 
Method Summary
static java.security.KeyPair getKeyPair(java.lang.String keyName)
          Returns the public and private keys associated with a given name
static KeyDirectoryInterface getPrivateInterface()
           
static java.security.PrivateKey getPrivateKey(java.lang.String keyName)
          Returns the private key associated with a given name
static KeyDirectoryInterface getPublicInterface()
           
static java.security.PublicKey getPublicKey(java.lang.String keyName)
          Returns the public key associated with a given name
static void init(KeyDirectoryInterface _publicDir)
          Set up KeyDirectory for use with a given implementation.
static void init(KeyDirectoryInterface _publicDir, KeyDirectoryInterface _privateDir)
          Set up KeyDirectory for use with a given implementation.
 boolean isInitialized()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

publicDir

private static KeyDirectoryInterface publicDir

privateDir

private static KeyDirectoryInterface privateDir

initialized

private static boolean initialized
Constructor Detail

KeyDirectory

public KeyDirectory()
Method Detail

isInitialized

public boolean isInitialized()

getPublicKey

public static java.security.PublicKey getPublicKey(java.lang.String keyName)
Returns the public key associated with a given name

Parameters:
keyName - the name of the key
Returns:
the PublicKey associated with the name

getPrivateKey

public static java.security.PrivateKey getPrivateKey(java.lang.String keyName)
Returns the private key associated with a given name

Parameters:
keyName - the name of the key
Returns:
the PrivateKey associated with the name

getKeyPair

public static java.security.KeyPair getKeyPair(java.lang.String keyName)
Returns the public and private keys associated with a given name

Parameters:
keyName - the name of the key
Returns:
the KeyPair associated with the name

init

public static void init(KeyDirectoryInterface _publicDir)
Set up KeyDirectory for use with a given implementation. Must be called before using KeyDirectory, but may be called again to change the implementation.

Parameters:
_publicDir - the public directory service (will also be used as the private directory service if it implements it)

init

public static void init(KeyDirectoryInterface _publicDir,
                        KeyDirectoryInterface _privateDir)
Set up KeyDirectory for use with a given implementation. Must be called before using KeyDirectory, but may be called again to change the implementation.

Parameters:
_publicDir - the public directory service
_privateDir - the private directory service

getPublicInterface

public static KeyDirectoryInterface getPublicInterface()

getPrivateInterface

public static KeyDirectoryInterface getPrivateInterface()


Copyright (c) 2002-2003 New York University RLAB