edu.nyu.cs.pdsg.switchboard.cipher
Class SbCipherLayer

java.lang.Object
  extended byedu.nyu.cs.pdsg.switchboard.SbStatus
      extended byedu.nyu.cs.pdsg.switchboard.SbLayer
          extended byedu.nyu.cs.pdsg.switchboard.cipher.SbCipherLayer
All Implemented Interfaces:
SbAsyncTransportClient, SbAsyncTransportProvider, SbAsyncTransportRecipient, SbClient, SbLayerable, SbProvider

public class SbCipherLayer
extends SbLayer

A layer to encrypt objects that pass through it, and provide secure key exchange


Field Summary
(package private)  org.ietf.jgss.GSSContext channel
           
(package private)  boolean client
           
static org.ietf.jgss.Oid elFakeoRSAID
           
protected static org.ietf.jgss.GSSManager gssmanager
           
(package private)  org.ietf.jgss.GSSCredential myCreds
           
(package private)  boolean okNotSent
           
(package private)  java.util.Vector waitQ
           
static int WRAP_LENGTH
           
 
Fields inherited from class edu.nyu.cs.pdsg.switchboard.SbLayer
createStackTrace, eventHandler, provider, recipient
 
Fields inherited from class edu.nyu.cs.pdsg.switchboard.SbStatus
STATUS_CLOSED, STATUS_LIVE, STATUS_PARTNER_CLOSED, STATUS_RECOVERABLE, STATUS_UNRECOVERABLE
 
Constructor Summary
SbCipherLayer()
          exists only for reflection getClass() usage
SbCipherLayer(SbAsyncTransportProvider _provider, java.security.KeyPair key, boolean _client)
          Initialize a SbCipherLayer
 
Method Summary
 void deliver(java.lang.Object omsg)
          Defines the behavior how to deliver an Object to the layer above.
 void encodeAndSend(java.lang.Object o)
           
 java.lang.String getLayerType()
           
 java.security.PublicKey getLocalPublicKey()
           
 java.security.PublicKey getRemotePublicKey()
           
 void init()
          Run all initialization code.
 void providerReady()
          called when provider is ready
static void setGSSManager(org.ietf.jgss.GSSManager _gssmanager)
           
private  byte[] unwrap(byte[] b)
          WHAT THE HELL ARE THESE METHODS DOING?
private  byte[] wrap(byte[] b)
          WHAT THE HELL ARE THESE METHODS DOING?
 void write(java.lang.Object msg)
          Defines the behavior how to deliver an Object to the layer above.
 
Methods inherited from class edu.nyu.cs.pdsg.switchboard.SbLayer
_close, behavesLike, close, closeQuiet, finalize, find, getProviderException, getProviderStackTrace, getProviderStatus, getTransportName, handleEvent, handleEvent, instanceOf, isKindOf, isOpen, isReady, providerStatusString, recipientReady, sendDown, sendUp, serialize, setClient, setEventHandler, setProvider, setProviderStatus, setProviderStatus, setProviderStatusSend, setRecipient, toShortString, toString, unserialize
 
Methods inherited from class edu.nyu.cs.pdsg.switchboard.SbStatus
statusString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

channel

org.ietf.jgss.GSSContext channel

client

boolean client

okNotSent

boolean okNotSent

waitQ

java.util.Vector waitQ

myCreds

org.ietf.jgss.GSSCredential myCreds

elFakeoRSAID

public static org.ietf.jgss.Oid elFakeoRSAID

gssmanager

protected static org.ietf.jgss.GSSManager gssmanager

WRAP_LENGTH

public static final int WRAP_LENGTH
See Also:
Constant Field Values
Constructor Detail

SbCipherLayer

public SbCipherLayer(SbAsyncTransportProvider _provider,
                     java.security.KeyPair key,
                     boolean _client)
              throws org.ietf.jgss.GSSException
Initialize a SbCipherLayer

Parameters:
_provider - The cipher layer provider this
key - The public keys used to identify this cipher to the correspondent
_client - True if this is the client (one side needs to initialize the key exchange. That is the client.)

SbCipherLayer

public SbCipherLayer()
exists only for reflection getClass() usage

Method Detail

setGSSManager

public static void setGSSManager(org.ietf.jgss.GSSManager _gssmanager)

init

public void init()
Description copied from class: SbLayer
Run all initialization code. No messages should be sent prior to init() being called. Don't call lower layer until ready to receive messages.

Specified by:
init in interface SbProvider
Overrides:
init in class SbLayer

providerReady

public void providerReady()
Description copied from interface: SbClient
called when provider is ready

Specified by:
providerReady in interface SbClient
Overrides:
providerReady in class SbLayer

wrap

private byte[] wrap(byte[] b)
             throws org.ietf.jgss.GSSException,
                    java.io.IOException
WHAT THE HELL ARE THESE METHODS DOING?

Throws:
org.ietf.jgss.GSSException
java.io.IOException

unwrap

private byte[] unwrap(byte[] b)
               throws org.ietf.jgss.GSSException,
                      java.io.IOException
WHAT THE HELL ARE THESE METHODS DOING?

Throws:
org.ietf.jgss.GSSException
java.io.IOException

write

public void write(java.lang.Object msg)
Description copied from interface: SbAsyncTransportProvider
Defines the behavior how to deliver an Object to the layer above.

Specified by:
write in interface SbAsyncTransportProvider
Overrides:
write in class SbLayer

encodeAndSend

public void encodeAndSend(java.lang.Object o)

deliver

public void deliver(java.lang.Object omsg)
Description copied from interface: SbAsyncTransportRecipient
Defines the behavior how to deliver an Object to the layer above.

Specified by:
deliver in interface SbAsyncTransportRecipient
Overrides:
deliver in class SbLayer

getLocalPublicKey

public java.security.PublicKey getLocalPublicKey()
                                          throws org.ietf.jgss.GSSException
Throws:
org.ietf.jgss.GSSException

getRemotePublicKey

public java.security.PublicKey getRemotePublicKey()
                                           throws org.ietf.jgss.GSSException
Throws:
org.ietf.jgss.GSSException

getLayerType

public java.lang.String getLayerType()
Overrides:
getLayerType in class SbLayer


Copyright (c) 2002-2003 New York University RLAB