Package org.globus.gsi.gssapi.net

# Class GssSocket

java.lang.Object
java.net.Socket
org.globus.net.WrappedSocket
org.globus.gsi.gssapi.net.GssSocket

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`

Direct Known Subclasses:
  `GSIGssSocket`

public abstract class GssSocket extends WrappedSocket

## Field Summary

Fields
Modifier and Type
Field
Description
`protected Authorization`
`authorization`
`protected boolean`
`clientMode`
`protected GSSContext`
`context`
`static final int`
`GSI_MODE`
`protected InputStream`
`in`
`protected int`
`mode`
`protected OutputStream`
`out`
`static final int`
`SSL_MODE`

### Fields inherited from class org.globus.net.WrappedSocket

`socket`

## Constructor Summary

Constructors
Constructor
Description
`GssSocket(String host, int port, GSSContext context)`
`GssSocket(Socket socket, GSSContext context)`

## Method Summary

Modifier and Type
Method
Description
`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, getOption, getRemoteSocketAddress, getReuseAddress, getTrafficClass, isBound, isClosed, isConnected, isInputShutdown, isOutputShutdown, sendUrgentData, setOOBInline, setOption, setPerformancePreferences, setReuseAddress, setSocketImplFactory, setTrafficClass, supportedOptions`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### 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 Details

### GssSocket

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

Throws:
  `IOException`

### GssSocket

public GssSocket(Socket socket, GSSContext context)

## Method Details

### 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

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `Closeable`
Overrides:
  `close` in class `WrappedSocket`
Throws:
  `IOException`