cgl.narada.service.security.kmc
Class KMCClient

java.lang.Object
  extended by cgl.narada.service.security.kmc.KMCClient
All Implemented Interfaces:
NBEventListener

public class KMCClient
extends Object
implements NBEventListener


Created on Sep 9, 2005


Field Summary
static byte MSG_ERROR
           
static byte MSG_SECURITY_TOKEN
           
 
Constructor Summary
KMCClient(Certificate cer, PrivateKey priv, PublicKey rootPub, String kmcTopic, String configFilePath)
           
KMCClient(Certificate cer, PrivateKey priv, PublicKey rootPub, String kmcTopic, String configFilePath, String host, String port, String prot)
           
 
Method Summary
 void close()
           
 boolean init(String configFilePath)
          Initializes the KMCClient.
 void onEvent(NBEvent nbEvent)
          Upon the receipt of an event which has satisfied all the constraints, if any were provided, that needed to be satisfied prior to delivery
 SecureTopicKeyResponse registerTopic(Hashtable pubs, Hashtable subs, SignedTopicAdvertisement sta, Certificate creds, Calendar validUntil, String keyGenAlgo, int keySize, int timeout)
          Registers a topic with the kmc to be a secure topic.
 SecureTopicKeyResponse requestTopicKey(String synopsis, Certificate creds, TopicRights reqRights, int timeout)
          Request a topic key to publish or subscribe to a topic owned by some other entity
 void send(String topicName, byte[] request)
          Send the specified message on specified topic
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MSG_SECURITY_TOKEN

public static final byte MSG_SECURITY_TOKEN
See Also:
Constant Field Values

MSG_ERROR

public static final byte MSG_ERROR
See Also:
Constant Field Values
Constructor Detail

KMCClient

public KMCClient(Certificate cer,
                 PrivateKey priv,
                 PublicKey rootPub,
                 String kmcTopic,
                 String configFilePath,
                 String host,
                 String port,
                 String prot)

KMCClient

public KMCClient(Certificate cer,
                 PrivateKey priv,
                 PublicKey rootPub,
                 String kmcTopic,
                 String configFilePath)
Method Detail

init

public boolean init(String configFilePath)
Initializes the KMCClient. This process involves finding a broker to connect to (uses Broker Discovery mechanisms), Using topic discovery to find a suitable KMC, and subscribing to appropriate topics.

Returns:
TRUE if successful, FALSE otherwise

close

public void close()

registerTopic

public SecureTopicKeyResponse registerTopic(Hashtable pubs,
                                            Hashtable subs,
                                            SignedTopicAdvertisement sta,
                                            Certificate creds,
                                            Calendar validUntil,
                                            String keyGenAlgo,
                                            int keySize,
                                            int timeout)
Registers a topic with the kmc to be a secure topic.

Parameters:
pubs - - A vector of allowed publishers to this topic
subs - - A vector of allowed subscribers to this topic
sta - - The signed topic advertisement. The signature will be verified with the public key.
creds - - The Certificate of the entity (owner of the topic)
validUntil - - Validity period of the secure topic
keyGenAlgo - - The Secret key generation algorithm to use (default AES)
keySize - - Size of the key (default 1024)
timeout - - Time for which to wait for the final response from the KMC
Returns:
Secrect topic key and tokenm if successful, NULL otherwise

requestTopicKey

public SecureTopicKeyResponse requestTopicKey(String synopsis,
                                              Certificate creds,
                                              TopicRights reqRights,
                                              int timeout)
Request a topic key to publish or subscribe to a topic owned by some other entity

Parameters:
synopsis - - The topic synopsis in question
creds -
reqRights -
timeout -
Returns:

send

public void send(String topicName,
                 byte[] request)
Send the specified message on specified topic

Parameters:
topicName - - The topic on which to send the message
request - - The message to be sent

onEvent

public void onEvent(NBEvent nbEvent)
Description copied from interface: NBEventListener
Upon the receipt of an event which has satisfied all the constraints, if any were provided, that needed to be satisfied prior to delivery

Specified by:
onEvent in interface NBEventListener


For comments and suggestions please send e-mail to The NaradaBrokering Project