org.globus.gsi.gssapi.net
Class GssSocket

java.lang.Object
  extended by java.net.Socket
      extended by org.globus.net.WrappedSocket
          extended by org.globus.gsi.gssapi.net.GssSocket
Direct Known Subclasses:
GSIGssSocket

public abstract class GssSocket
extends WrappedSocket


Field Summary
protected  Authorization authorization
           
protected  boolean clientMode
           
protected  GSSContext context
           
static int GSI_MODE
           
protected  InputStream in
           
protected  int mode
           
protected  OutputStream out
           
static int SSL_MODE
           
 
Fields inherited from class org.globus.net.WrappedSocket
socket
 
Constructor Summary
GssSocket(Socket socket, GSSContext context)
           
GssSocket(String host, int port, GSSContext context)
           
 
Method Summary
protected  void authenticateClient()
           
protected  void authenticateServer()
           
 void close()
          Disposes of the context and closes the connection
 Authorization getAuthorization()
           
 boolean getClientMode()
           
 GSSContext getContext()
           
 InputStream getInputStream()
           
 OutputStream getOutputStream()
           
 int getWrapMode()
           
protected abstract  byte[] readToken()
           
 void setAuthorization(Authorization auth)
           
 void setUseClientMode(boolean clientMode)
           
 void setWrapMode(int mode)
           
 void startHandshake()
           
protected abstract  void writeToken(byte[] token)
           
 
Methods inherited from class org.globus.net.WrappedSocket
getInetAddress, getKeepAlive, getLocalAddress, getLocalPort, getPort, getReceiveBufferSize, getSendBufferSize, getSoLinger, getSoTimeout, getTcpNoDelay, getWrappedSocket, setKeepAlive, setReceiveBufferSize, setSendBufferSize, setSoLinger, setSoTimeout, setTcpNoDelay, shutdownInput, shutdownOutput, toString
 
Methods inherited from class java.net.Socket
bind, connect, connect, getChannel, getLocalSocketAddress, getOOBInline, getRemoteSocketAddress, getReuseAddress, getTrafficClass, isBound, isClosed, isConnected, isInputShutdown, isOutputShutdown, sendUrgentData, setOOBInline, setPerformancePreferences, setReuseAddress, setSocketImplFactory, setTrafficClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

context

protected GSSContext context

clientMode

protected boolean clientMode

in

protected InputStream in

out

protected OutputStream out

authorization

protected Authorization authorization

SSL_MODE

public static final int SSL_MODE
See Also:
Constant Field Values

GSI_MODE

public static final int GSI_MODE
See Also:
Constant Field Values

mode

protected int mode
Constructor Detail

GssSocket

public GssSocket(String host,
                 int port,
                 GSSContext context)
          throws IOException
Throws:
IOException

GssSocket

public GssSocket(Socket socket,
                 GSSContext context)
Method Detail

setAuthorization

public void setAuthorization(Authorization auth)

getAuthorization

public Authorization getAuthorization()

setUseClientMode

public void setUseClientMode(boolean clientMode)

getClientMode

public boolean getClientMode()

setWrapMode

public void setWrapMode(int mode)

getWrapMode

public int getWrapMode()

getContext

public GSSContext getContext()

writeToken

protected abstract void writeToken(byte[] token)
                            throws IOException
Throws:
IOException

readToken

protected abstract byte[] readToken()
                             throws IOException
Throws:
IOException

authenticateClient

protected void authenticateClient()
                           throws IOException,
                                  GSSException
Throws:
IOException
GSSException

authenticateServer

protected void authenticateServer()
                           throws IOException,
                                  GSSException
Throws:
IOException
GSSException

startHandshake

public void startHandshake()
                    throws IOException
Throws:
IOException

getOutputStream

public OutputStream getOutputStream()
                             throws IOException
Overrides:
getOutputStream in class WrappedSocket
Throws:
IOException

getInputStream

public InputStream getInputStream()
                           throws IOException
Overrides:
getInputStream in class WrappedSocket
Throws:
IOException

close

public void close()
           throws IOException
Disposes of the context and closes the connection

Overrides:
close in class WrappedSocket
Throws:
IOException