com.informix.csm.crypto

## Class IfxGssCsm

- java.lang.Object
- - com.informix.csm.crypto.IfxGssCsm

All Implemented Interfaces:
  IfxCsm

Direct Known Subclasses:
  Gsscsm

    public class IfxGssCsm
    extends java.lang.Object
    implements IfxCsm

### Nested Class Summary

### Nested classes/interfaces inherited from interface com.informix.csm.IfxCsm

`IfxCsm.AbortInfo, IfxCsm.Credentials, IfxCsm.Status`

### Field Summary

### Fields inherited from interface com.informix.csm.IfxCsm

`CSM_AUTH_ERROR, CSM_AUTHENTICATION_ERROR, CSM_DISCONNECT, CSM_DONE, CSM_DONE_MORE_OUTPUT_AVAILABLE, CSM_ERROR, CSM_FILE_IO_ERROR, CSM_INTERNAL_PROCESSING_ERROR, CSM_INVALID_CONTEXT, CSM_INVALID_CTX_OPTIONS, CSM_INVALID_INIT_OPTIONS, CSM_MAX_ERROR, CSM_MEM_ALLOC_ERROR, CSM_MEM_FREE_ERROR, CSM_MIN_ERROR, CSM_MORE_INPUT_NEEDED, CSM_MSG_OF_UNEXPECTED_TYPE, CSM_NO_LOCAL_CREDENTIALS, CSM_PROTOCOL_ERROR, CSM_RECV_OK, CSM_SEND_OK, CSM_SENDTOPEER, CSM_SENDTOPEER_MORE_OUTPUT_AVAILABLE, CSM_UNSUPPORTED_FEATURE, FUNCFAIL, FUNCSUCC, INFORMIX_CSM_INTERFACE`

### Constructor Summary

Constructors
Constructor and Description
`IfxGssCsm(IfxCsmDescriptor csmdescr)` initialises csm.

### Method Summary

All Methods Instance Methods Concrete Methods
`IfxCsmDescriptor` `getDescriptor()`
`int` `ifxCsmAbortContext(java.lang.Object csmContext, IfxCsm.AbortInfo abortInfo, IfxCsm.Status status)`
`int` `ifxCsmAcceptContext(java.lang.Object csmContext, IfxCsm.Credentials cred, IfxCsmReadBuffer inHandshake, IfxCsmBuffer outHandShake, java.lang.String contextInitString, IfxCsm.Status status)`
`int` `ifxCsmCreateContext(IfxCsm.Credentials credentials, IfxCsmReadBuffer inHndShk, IfxCsmBuffer outHndShk, java.lang.String contextInitString, IfxCsm.Status status)` Create a connection.
`long` `ifxCsmGetAttributeFlags(IfxCsm.Status status)`
`int` `ifxCsmInit(java.lang.String csmInitString, long flags, IfxCsm.Status status)`
`int` `ifxCsmProcessInMessage(IfxCsmReadBuffer inBuffer, IfxCsmBuffer outBuffer, IfxCsm.Status status)` This method does not modify contents of inBuffer in any manner Also does not reference to inBuffer's internal buffer with anybody Also decrypted bytes are appended to existing contents of outBuffer , if any initial contents of outBuffer are NOT lost Also
`int` `ifxCsmProcessOutMessage(IfxCsmReadBuffer inBuffer, IfxCsmBuffer outBuffer, IfxCsm.Status status)` inBuffer contains bytes to be encrypted this method does not change inBuffer in any manner.
`int` `ifxCsmReleaseContext(IfxCsmReadBuffer inHandshake, IfxCsmBuffer outHandShake, IfxCsm.Status status)`
`int` `ifxCsmTerminate(IfxCsm.Status status)`

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

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

### Constructor Detail

#### IfxGssCsm

    public IfxGssCsm(IfxCsmDescriptor csmdescr)
              throws IfxCsmException

initialises csm. constructor should set load_state from descriptor to CSS_CSM_LOADING_ERROR in case anything goes wrong.. such as initString for csm is not in right format etc.

Parameters:
  `csmdescr` -
Throws:
  `IfxCsmException`

### Method Detail

#### getDescriptor

    public IfxCsmDescriptor getDescriptor()

#### ifxCsmInit

    public int ifxCsmInit(java.lang.String csmInitString,
                          long flags,
                          IfxCsm.Status status)
                   throws IfxCsmException

Specified by:
  `ifxCsmInit` in interface `IfxCsm`
Parameters:
  `csmInitString` -
  `flags` -
  `status` -
Returns:
Throws:
  `IfxCsmException`

#### ifxCsmTerminate

    public int ifxCsmTerminate(IfxCsm.Status status)

Specified by:
  `ifxCsmTerminate` in interface `IfxCsm`

#### ifxCsmGetAttributeFlags

    public long ifxCsmGetAttributeFlags(IfxCsm.Status status)

Specified by:
  `ifxCsmGetAttributeFlags` in interface `IfxCsm`

#### ifxCsmCreateContext

    public int ifxCsmCreateContext(IfxCsm.Credentials credentials,
                                   IfxCsmReadBuffer inHndShk,
                                   IfxCsmBuffer outHndShk,
                                   java.lang.String contextInitString,
                                   IfxCsm.Status status)
                            throws IfxCsmException

Create a connection. There are several states during the connection phase: ENC_CSM_STATE_INITIAL Just initialized the context ENC_CSM_STATE_INITSTRING I have created the init string ENC_CSM_STATE_INITSTRINGPENDING I have created the init string, but not yet sent it. I probably received the peer string first and need to fully accept it. END_CSM_STATE_INITSTRING_SEND Send the init string END_CSM_STATE_READY Ready to enter data transfer

Specified by:
  `ifxCsmCreateContext` in interface `IfxCsm`
Parameters:
  `cred` -
  `inHandshake` -
  `outHandShake` -
  `contextInitString` -
  `status` -
Returns:
Throws:
  `IfxCsmException`

#### ifxCsmProcessOutMessage

    public int ifxCsmProcessOutMessage(IfxCsmReadBuffer inBuffer,
                                       IfxCsmBuffer outBuffer,
                                       IfxCsm.Status status)
                                throws IfxCsmException

inBuffer contains bytes to be encrypted this method does not change inBuffer in any manner. Also encrypted bytes are appended to existing contents of outBuffer initial contents of outBuffer are NOT lost Check to make sure that status.setCsmCode is CSM_DONE

Specified by:
  `ifxCsmProcessOutMessage` in interface `IfxCsm`
Parameters:
  `inBuffer` -
  `outBuffer` -
  `status` -
Returns:
  FUNCSUCC if no errors FUNCFAIL if some error occured
Throws:
  `IfxCsmException`

#### ifxCsmProcessInMessage

    public int ifxCsmProcessInMessage(IfxCsmReadBuffer inBuffer,
                                      IfxCsmBuffer outBuffer,
                                      IfxCsm.Status status)
                               throws IfxCsmException

This method does not modify contents of inBuffer in any manner Also does not reference to inBuffer's internal buffer with anybody Also decrypted bytes are appended to existing contents of outBuffer , if any initial contents of outBuffer are NOT lost Also

Specified by:
  `ifxCsmProcessInMessage` in interface `IfxCsm`
Parameters:
  `inBuffer` -
  `outBuffer` -
  `status` -
Returns:
  if inBuffer is null or there is nothing in it , CsmCode is set to CSM_MORE_INPUT_NEEDED , with return value of FUNCSUCC if sum of bytes in inBuffer and the number of bytes in internal saved buffer is smaller than size of Header (IfxGssMsgHdr.GSS_CSM_HDRSIZE) , CsmCode is set to CSM_MORE_INPUT_NEEDED . if sum of bytes in inBuffer and the number of bytes in internal saved buffer is smaller than sum of IfxGssMsgHdr.GSS_CSM_HDRSIZE and the size of message itself , CsmCode is set to CSM_MORE_INPUT_NEEDED . Otherwise CsmCode is set to CSM_DONE
Throws:
  `IfxCsmException`

#### ifxCsmAbortContext

    public int ifxCsmAbortContext(java.lang.Object csmContext,
                                  IfxCsm.AbortInfo abortInfo,
                                  IfxCsm.Status status)

Specified by:
  `ifxCsmAbortContext` in interface `IfxCsm`

#### ifxCsmReleaseContext

    public int ifxCsmReleaseContext(IfxCsmReadBuffer inHandshake,
                                    IfxCsmBuffer outHandShake,
                                    IfxCsm.Status status)
                             throws IfxCsmException

Specified by:
  `ifxCsmReleaseContext` in interface `IfxCsm`
Throws:
  `IfxCsmException`

#### ifxCsmAcceptContext

    public int ifxCsmAcceptContext(java.lang.Object csmContext,
                                   IfxCsm.Credentials cred,
                                   IfxCsmReadBuffer inHandshake,
                                   IfxCsmBuffer outHandShake,
                                   java.lang.String contextInitString,
                                   IfxCsm.Status status)
                            throws IfxCsmException

Specified by:
  `ifxCsmAcceptContext` in interface `IfxCsm`
Throws:
  `IfxCsmException`