com.ibm.security.jgss

Class GSSContextImpl

  1. java.lang.Object
  2. extended bycom.ibm.security.jgss.GSSContextImpl
All implemented interfaces:
GSSContext

  1. public class GSSContextImpl
  2. extends java.lang.Object
  3. implements GSSContext
Implements the GSSContext interface.

Based on the IETF RFC 2853 "Generic Security Service API Version 2: Java Bindings."

Version:
1.2, 10/5/07
Author:
Thomas Owusu

Field Summary

Fields inherited from interface org.ietf.jgss.GSSContext
DEFAULT_LIFETIME, INDEFINITE_LIFETIME

Method Summary

Modifier and Type Method and Description
  1. byte[]
acceptSecContext(byte[] inToken,int offset,int len)
  1. void
acceptSecContext(java.io.InputStream inStream,java.io.OutputStream outStream)
  1. void
dispose()
  1. byte[]
export()
  1. boolean
getAnonymityState()
  1. boolean
getConfState()
  1. boolean
getCredDelegState()
  1. GSSCredential
getDelegCred()
  1. boolean
getIntegState()
  1. int
getLifetime()
  1. Oid
getMech()
  1. byte[]
getMIC(byte[] inMsg,int offset,int len,MessageProp msgProp)
  1. void
getMIC(java.io.InputStream inStream,java.io.OutputStream outStream,MessageProp msgProp)
  1. boolean
getMutualAuthState()
  1. Oid[]
getNegMechs(GSSCredential cred)
  1. boolean
getReplayDetState()
  1. boolean
getSequenceDetState()
  1. GSSName
getSrcName()
  1. GSSName
getTargName()
  1. int
getWrapSizeLimit(int qop,boolean confReq,int maxTokenSize)
  1. byte[]
initSecContext(byte[] inputBuf,int offset,int len)
  1. int
initSecContext(java.io.InputStream inStream,java.io.OutputStream outStream)
  1. boolean
isEstablished()
  1. boolean
isInitiator()
  1. boolean
isProtReady()
  1. boolean
isTransferable()
  1. void
requestAnonymity(boolean state)
  1. void
requestConf(boolean state)
  1. void
requestCredDeleg(boolean state)
  1. void
requestInteg(boolean state)
  1. void
requestLifetime(int lifetime)
  1. void
requestMutualAuth(boolean state)
  1. void
requestReplayDet(boolean state)
  1. void
requestSequenceDet(boolean state)
  1. void
setChannelBinding(ChannelBinding cb)
  1. void
setNegMechs(Oid[] mechTypes,GSSCredential credential)
  1. java.lang.String
toString()
  1. byte[]
unwrap(byte[] inBuf,int offset,int len,MessageProp msgProp)
  1. void
unwrap(java.io.InputStream inStream,java.io.OutputStream outStream,MessageProp msgProp)
  1. void
verifyMIC(byte[] inTok,int tokOffset,int tokLen,byte[] inMsg,int msgOffset,int msgLen,MessageProp msgProp)
  1. void
verifyMIC(java.io.InputStream tokStream,java.io.InputStream msgStream,MessageProp msgProp)
  1. byte[]
wrap(byte[] inBuf,int offset,int len,MessageProp msgProp)
  1. void
wrap(java.io.InputStream inStream,java.io.OutputStream outStream,MessageProp msgProp)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Method Detail

initSecContext

  1. public byte[] initSecContext(byte[] inputBuf,
  2. int offset,
  3. int len)
  4. throws GSSException
Description copied from interface: GSSContext
Initiates context establishment. Called by the context initiator to start the context creation process. This is equivalent to the stream based method except that the token buffers are handled as byte arrays instead of using stream objects. This method may return an output token which the application will need to send to the peer for processing by the accept call. "null" return value indicates that no token needs to be sent to the peer. The application can call isEstablished() to determine if the context establishment phase is complete for this peer. A return value of "false" from isEstablished() indicates that more tokens are expected to be supplied to the initSecContext() method. Note that it is possible that the initSecContext() method return a token for the peer, and isEstablished() return "true" also. This indicates that the token needs to be sent to the peer, but the local end of the context is now fully established.

Upon completion of the context establishment, the available context options may be queried through the get methods.

Specified by:
initSecContext in interface GSSContext
Parameters:
inputBuf - Token generated by the peer. This parameter is ignored on the first call.
offset - The offset within the inputBuf where the token begins.
len - The length of the token within the inputBuf (starting at the offset).
Returns:
The token to be transmitted to the peer. Null is returned if no token needs to be sent.
Throws:

initSecContext

  1. public int initSecContext(java.io.InputStream inStream,
  2. java.io.OutputStream outStream)
  3. throws GSSException
Description copied from interface: GSSContext
Initiates context establishment. Called by the context initiator to start the context creation process. This is equivalent to the byte array based method. This method may write an output token to the outStream, which the application will need to send to the peer for processing by the accept call. 0 bytes written to the output stream indicate that no token needs to be sent to the peer. The application can call isEstablished() to determine if the context establishment phase is complete for this peer. A return value of "false" from isEstablished indicates that more tokens are expected to be supplied to the initSecContext method. Note that it is possible that the initSecContext() method return a token for the peer, and isEstablished() return "true" also. This indicates that the token needs to be sent to the peer, but the local end of the context is now fully established.

The GSS-API authentication tokens contain a definitive start and end. This method will attempt to read one of these tokens per invocation, and may block on the stream if only part of the token is available.

Upon completion of the context establishment, the available context options may be queried through the get methods.

Specified by:
initSecContext in interface GSSContext
Parameters:
inStream - Contains the token generated by the peer. This parameter is ignored on the first call.
outStream - Output stream where the output token will be written. During the final stage of context establishment, there may be no bytes written.
Returns:
The number of bytes written to the output stream.
Throws:

acceptSecContext

  1. public byte[] acceptSecContext( byte[] inToken,
  2. int offset,
  3. int len)
  4. throws GSSException
Description copied from interface: GSSContext
Accepts a context token received from a context initiator. Called by the context acceptor upon receiving a token from the peer. This call is equivalent to the stream based method except that the token buffers are handled as byte arrays instead of using stream objects.

This method may return an output token which the application will need to send to the peer for further processing by the init call. "null" return value indicates that no token needs to be sent to the peer. The application can call isEstablished() to determine if the context establishment phase is complete for this peer. A return value of "false" from isEstablished() indicates that more tokens are expected to be supplied to this method.

Note that it is possible that acceptSecContext() return a token for the peer, and isEstablished() return "true" also. This indicates that the token needs to be sent to the peer, but the local end of the context is now fully established.

Upon completion of the context establishment, the available context options may be queried through the get methods.

Specified by:
offset - The offset within the inTok where the token begins.
len - The length of the token within the inTok (starting at the offset).
Returns:
Token to be sent to the peer. Null if no token is to be sent to the peer.
Throws:

acceptSecContext

  1. public void acceptSecContext(java.io.InputStream inStream,
  2. java.io.OutputStream outStream)
  3. throws GSSException
Description copied from interface: GSSContext
Accepts a context token received from a context initiator. Called by the context acceptor upon receiving a token from the peer. This call is equivalent to the byte array method. It may write an output token to the outStream, which the application will need to send to the peer for processing by its initSecContext method. 0 bytes written to the output stream indicate that no token needs to be sent to the peer. The application can call isEstablished() to determine if the context establishment phase is complete for this peer. A return value of "false" from isEstablished() indicates that more tokens are expected to be supplied to this method.

Note that it is possible that acceptSecContext() return a token for the peer, and isEstablished() return "true" also. This indicates that the token needs to be sent to the peer, but the local end of the context is now fully established.

The GSS-API authentication tokens contain a definitive start and end. This method will attempt to read one of these tokens per invocation, and may block on the stream if only part of the token is available.

Upon completion of the context establishment, the available context options may be queried through the get methods.

Specified by:
Parameters:
inStream - Contains the token generated by the peer.
outStream - Output stream where the output token will be written. During the final stage of context establishment, there may be no bytes written.
Throws:

isEstablished

  1. public boolean isEstablished()
Description copied from interface: GSSContext
Used during context establishment to determine the state of the context. Returns "true" if this is a fully established context on the caller's side and no more tokens are needed from the peer. Should be called after a call to initSecContext() or acceptSecContext() when no GSSException is thrown.
Specified by:
isEstablished in interface GSSContext
Returns:
"true" if this is a fully established context.

dispose

  1. public void dispose()
  2. throws GSSException
Description copied from interface: GSSContext
Releases any system resources and cryptographic information stored in the context object. This will invalidate the context.
Specified by:
dispose in interface GSSContext
Throws:

getWrapSizeLimit

  1. public int getWrapSizeLimit(int qop,
  2. boolean confReq,
  3. int maxTokenSize)
  4. throws GSSException
Description copied from interface: GSSContext
Returns the maximum message size that, if presented to the wrap method with the same confReq and qop parameters, will result in an output token containing no more than the maxTokenSize bytes.

This call is intended for use by applications that communicate over protocols that impose a maximum message size. It enables the application to fragment messages prior to applying protection.

GSS-API implementations are recommended but not required to detect invalid QOP values when getWrapSizeLimit is called. This routine guarantees only a maximum message size, not the availability of specific QOP values for message protection.

Successful completion of this call does not guarantee that wrap will be able to protect a message of the computed length, since this ability may depend on the availability of system resources at the time that wrap is called. However, if the implementation itself imposes an upper limit on the length of messages that may be processed by wrap, the implementation should not return a value that is greater than this length.

Specified by:
Parameters:
qop - Indicates the level of protection wrap will be asked to provide.
confReq - Indicates if wrap will be asked to provide privacy service.
maxTokenSize - The desired maximum size of the token emitted by wrap.
Returns:
The size of buffer.
Throws:

wrap

  1. public byte[] wrap(byte[] inBuf,
  2. int offset,
  3. int len,
  4. MessageProp msgProp)
  5. throws GSSException
Description copied from interface: GSSContext
Applies per-message security services over the established security context. The method will return a token with a cryptographic MIC and may optionally encrypt the specified inBuf. This method is equivalent in functionality to its stream counterpart. The returned byte array will contain both the MIC and the message.

The MessageProp object is instantiated by the application and used to specify a QOP value which selects cryptographic algorithms, and a privacy service to optionally encrypt the message. The underlying mechanism that is used in the call may not be able to provide the privacy service. It sets the actual privacy service that it does provide in this MessageProp object which the caller should then query upon return. If the mechanism is not able to provide the requested QOP, it throws a GSSException with the BAD_QOP code.

Since some application-level protocols may wish to use tokens emitted by wrap to provide "secure framing", implementations should support the wrapping of zero-length messages.

The application will be responsible for sending the token to the peer.

Specified by:
wrap in interface GSSContext
Parameters:
inBuf - Application data to be protected.
offset - The offset within the inBuf where the data begins.
len - The length of the data within the inBuf (starting at the offset).
msgProp - Instance of MessageProp that is used by the application to set the desired QOP and privacy state. Set the desired QOP to 0 to request the default QOP. Upon return from this method, this object will contain the the actual privacy state that was applied to the message by the underlying mechanism.
Returns:
The wrapped token.
Throws:

wrap

  1. public void wrap(java.io.InputStream inStream,
  2. java.io.OutputStream outStream,
  3. MessageProp msgProp)
  4. throws GSSException
Description copied from interface: GSSContext
Allows to apply per-message security services over the established security context. The method will produce a token with a cryptographic MIC and may optionally encrypt the message in inStream. The outStream will contain both the MIC and the message.

The MessageProp object is instantiated by the application and used to specify a QOP value which selects cryptographic algorithms, and a privacy service to optionally encrypt the message. The underlying mechanism that is used in the call may not be able to provide the privacy service. It sets the actual privacy service that it does provide in this MessageProp object which the caller should then query upon return. If the mechanism is not able to provide the requested QOP, it throws a GSSException with the BAD_QOP code.

Since some application-level protocols may wish to use tokens emitted by wrap to provide "secure framing", implementations should support the wrapping of zero-length messages.

The application will be responsible for sending the token to the peer.

Specified by:
wrap in interface GSSContext
Parameters:
inStream - Input stream containing the application data to be protected.
outStream - The output stream to write the protected message to. The application is responsible for sending this to the other peer for processing in its unwrap method.
msgProp - Instance of MessageProp that is used by the application to set the desired QOP and privacy state. Set the desired QOP to 0 to request the default QOP. Upon return from this method, this object will contain the the actual privacy state that was applied to the message by the underlying mechanism.
Throws:

unwrap

  1. public byte[] unwrap(byte[] inBuf,
  2. int offset,
  3. int len,
  4. MessageProp msgProp)
  5. throws GSSException
Description copied from interface: GSSContext
Used by the peer application to process tokens generated with the wrap call. This call is equal in functionality to its stream counterpart. The method will return the message supplied in the peer application to the wrap call, verifying the embedded MIC.

The MessageProp object is instantiated by the application and is used by the underlying mechanism to return information to the caller such as the QOP, whether confidentiality was applied to the message, and other supplementary message state information.

Since some application-level protocols may wish to use tokens emitted by wrap to provide "secure framing", implementations should support the wrapping and unwrapping of zero-length messages.

Specified by:
unwrap in interface GSSContext
Parameters:
inBuf - GSS-API wrap token received from peer.
offset - The offset within the inBuf where the token begins.
len - The length of the token within the inBuf (starting at the offset).
msgProp - Upon return from the method, this object will contain the applied QOP, the privacy state of the message, and supplementary information described in 4.12.3 stating whether the token was a duplicate, old, out of sequence or arriving after a gap.
Returns:
The unwrapped token.
Throws:

unwrap

  1. public void unwrap(java.io.InputStream inStream,
  2. java.io.OutputStream outStream,
  3. MessageProp msgProp)
  4. throws GSSException
Description copied from interface: GSSContext
Used by the peer application to process tokens generated with the wrap call. This call is equal in functionality to its byte array counterpart. It will produce the message supplied in the peer application to the wrap call, verifying the embedded MIC.

The MessageProp object is instantiated by the application and is used by the underlying mechanism to return information to the caller such as the QOP, whether confidentiality was applied to the message, and other supplementary message state information.

Since some application-level protocols may wish to use tokens emitted by wrap to provide "secure framing", implementations should support the wrapping and unwrapping of zero-length messages.

Specified by:
unwrap in interface GSSContext
Parameters:
inStream - Input stream containing the GSS-API wrap token received from the peer.
outStream - The output stream to write the application message to.
msgProp - Upon return from the method, this object will contain the applied QOP, the privacy state of the message, and supplementary information described in 4.12.3 stating whether the token was a duplicate, old, out of sequence or arriving after a gap.
Throws:

getMIC

  1. public byte[] getMIC(byte[] inMsg,
  2. int offset,
  3. int len,
  4. MessageProp msgProp)
  5. throws GSSException
Description copied from interface: GSSContext
Computes a cryptographic MIC over the supplied message. Returns a token containing a cryptographic MIC for the supplied message, for transfer to the peer application. Unlike wrap, which encapsulates the user message in the returned token, only the message MIC is returned in the output token. This method is identical in functionality to its stream counterpart.

Note that privacy can only be applied through the wrap call.

Since some application-level protocols may wish to use tokens emitted by getMIC to provide "secure framing", implementations should support derivation of MICs from zero-length messages.

Specified by:
getMIC in interface GSSContext
Parameters:
inMsg - Message to generate MIC over.
offset - The offset within the inMsg where the token begins.
len - The length of the token within the inMsg (starting at the offset).
msgProp - Instance of MessageProp that is used by the application to set the desired QOP. Set the desired QOP to 0 in msgProp to request the default QOP. Alternatively pass in "null" for msgProp to request default QOP.
Returns:
The cryptogaphic MIC.
Throws:

getMIC

  1. public void getMIC(java.io.InputStream inStream,
  2. java.io.OutputStream outStream,
  3. MessageProp msgProp)
  4. throws GSSException
Description copied from interface: GSSContext
Computes a cryptographic MIC over the supplied message. Produces a token containing a cryptographic MIC for the supplied message, for transfer to the peer application. Unlike wrap, which encapsulates the user message in the returned token, only the message MIC is produced in the output token. This method is identical in functionality to its byte array counterpart.

Note that privacy can only be applied through the wrap call.

Since some application-level protocols may wish to use tokens emitted by getMIC to provide "secure framing", implementations should support derivation of MICs from zero-length messages.

Specified by:
getMIC in interface GSSContext
Parameters:
inStream - Input stream containing the message to generate MIC over.
outStream - Output stream to write the GSS-API output token to.
msgProp - Instance of MessageProp that is used by the application to set the desired QOP. Set the desired QOP to 0 in msgProp to request the default QOP. Alternatively pass in "null" for msgProp to request default QOP.
Throws:

verifyMIC

  1. public void verifyMIC(byte[] inTok,
  2. int tokOffset,
  3. int tokLen,
  4. byte[] inMsg,
  5. int msgOffset,
  6. int msgLen,
  7. MessageProp msgProp)
  8. throws GSSException
Description copied from interface: GSSContext
Verifies the cryptographic MIC contained in the supplied token. The MIC is verified over the supplied message. This method is equivalent in functionality to its stream counterpart.

The MessageProp object is instantiated by the application and is used by the underlying mechanism to return information to the caller such as the QOP indicating the strength of protection that was applied to the message and other supplementary message state information.

Since some application-level protocols may wish to use tokens emitted by getMIC to provide "secure framing", implementations should support the calculation and verification of MICs over zero-length messages.

Specified by:
verifyMIC in interface GSSContext
Parameters:
inTok - Token generated by peer's getMIC method.
tokOffset - The offset within the inTok where the token begins.
inMsg - Application message to verify the cryptographic MIC over.
msgOffset - The offset within the inMsg where the message begins.
msgLen - The length of the message within the inMsg (starting at the offset).
msgProp - Upon return from the method, this object will contain the applied QOP and supplementary information described in 4.12.3 stating whether the token was a duplicate, old, out of sequence or arriving after a gap. The confidentiality state will be set to "false".
Throws:

verifyMIC

  1. public void verifyMIC(java.io.InputStream tokStream,
  2. java.io.InputStream msgStream,
  3. MessageProp msgProp)
  4. throws GSSException
Description copied from interface: GSSContext
Verifies the cryptographic MIC contained in the supplied token. The MIC is verified over the supplied message. This method is equivalent in functionality to its byte array counterpart.

The MessageProp object is instantiated by the application and is used by the underlying mechanism to return information to the caller such as the QOP indicating the strength of protection that was applied to the message and other supplementary message state information.

Since some application-level protocols may wish to use tokens emitted by getMIC to provide "secure framing", implementations should support the calculation and verification of MICs over zero-length messages.

Specified by:
verifyMIC in interface GSSContext
Parameters:
tokStream - Input stream containing the token generated by peer's getMIC method.
msgStream - Input stream containing the application message to verify the cryptographic MIC over.
msgProp - Upon return from the method, this object will contain the applied QOP and supplementary information described in 4.12.3 stating whether the token was a duplicate, old, out of sequence or arriving after a gap. The confidentiality state will be set to "false".
Throws:

export

  1. public byte[] export()
  2. throws GSSException
Description copied from interface: GSSContext
Provided to support the sharing of work between multiple processes. This routine will typically be used by the context-acceptor, in an application where a single process receives incoming connection requests and accepts security contexts over them, then passes the established context to one or more other processes for message exchange. This method deactivates the security context and creates an interprocess token which, when passed to the byte array constructor of the GSSContext interface in another process, will re-activate the context in the second process. Only a single instantiation of a given context may be active at any one time; a subsequent attempt by a context exporter to access the exported security context will fail. The implementation may constrain the set of processes by which the interprocess token may be imported, either as a function of local security policy, or as a result of implementation decisions. For example, some implementations may constrain contexts to be passed only between processes that run under the same account, or which are part of the same process group. The interprocess token may contain security-sensitive information (for example cryptographic keys). While mechanisms are encouraged to either avoid placing such sensitive information within interprocess tokens, or to encrypt the token before returning it to the application, in a typical GSS-API implementation this may not be possible. Thus the application must take care to protect the interprocess token, and ensure that any process to which the token is transferred is trustworthy.
Specified by:
export in interface GSSContext
Throws:

requestMutualAuth

  1. public void requestMutualAuth(boolean state)
  2. throws GSSException
Description copied from interface: GSSContext
Sets the request state of the mutual authentication flag for the context. This method is only valid before the context creation process begins and only for the initiator.
Specified by:
Parameters:
state - Boolean representing if mutual authentication should be requested during context establishment.
Throws:

requestReplayDet

  1. public void requestReplayDet(boolean state)
  2. throws GSSException
Description copied from interface: GSSContext
Sets the request state of the replay detection service for the context. This method is only valid before the context creation process begins and only for the initiator.
Specified by:
Parameters:
state - Boolean representing if replay detection is desired over the established context.
Throws:

requestSequenceDet

  1. public void requestSequenceDet( boolean state)
  2. throws GSSException
Description copied from interface: GSSContext
Sets the request state for the sequence checking service of the context. This method is only valid before the context creation process begins and only for the initiator.
Specified by:
Parameters:
state - Boolean representing if sequence detection is desired over the established context.
Throws:

requestCredDeleg

  1. public void requestCredDeleg(boolean state)
  2. throws GSSException
Description copied from interface: GSSContext
Sets the request state for the credential delegation flag for the context. This method is only valid before the context creation process begins and only for the initiator.
Specified by:
Parameters:
state - Boolean representing if credential delegation is desired.
Throws:

requestAnonymity

  1. public void requestAnonymity(boolean state)
  2. throws GSSException
Description copied from interface: GSSContext
Requests anonymous support over the context. This method is only valid before the context creation process begins and only for the initiator.
Specified by:
Parameters:
state - Boolean representing if anonymity support is requested.
Throws:

requestConf

  1. public void requestConf(boolean state)
  2. throws GSSException
Description copied from interface: GSSContext
Requests that confidentiality service be available over the context. This method is only valid before the context creation process begins and only for the initiator.
Specified by:
requestConf in interface GSSContext
Parameters:
state - Boolean indicating if confidentiality services are to be requested for the context.
Throws:

requestInteg

  1. public void requestInteg(boolean state)
  2. throws GSSException
Description copied from interface: GSSContext
Requests that integrity services be available over the context. This method is only valid before the context creation process begins and only for the initiator.
Specified by:
requestInteg in interface GSSContext
Parameters:
state - Boolean indicating if integrity services are to be requested for the context.
Throws:

requestLifetime

  1. public void requestLifetime(int lifetime)
  2. throws GSSException
Description copied from interface: GSSContext
Sets the desired lifetime for the context in seconds. This method is only valid before the context creation process begins and only for the initiator. Use GSSContext.INDEFINITE_LIFETIME and GSSContext.DEFAULT_LIFETIME to request indefinite and default context lifetime, respectively.
Specified by:
Parameters:
lifetime - The desired context lifetime in seconds.
Throws:

setChannelBinding

  1. public void setChannelBinding(ChannelBinding cb)
  2. throws GSSException
Description copied from interface: GSSContext
Sets the channel bindings to be used during context establishment. This method is only valid before the context creation process begins.
Specified by:
Parameters:
cb - Channel bindings to be used.
Throws:

setNegMechs

  1. public void setNegMechs(Oid[] mechTypes,
  2. GSSCredential credential)
  3. throws GSSException
Throws:

getCredDelegState

  1. public boolean getCredDelegState( )
Description copied from interface: GSSContext
Returns the state of the delegated credentials for the context. When issued before context establishment is completed or when the isProtReady method returns "false", it returns the desired state, otherwise it will indicate the actual state over the established context.
Specified by:
Returns:
Whether or not credentials are being delegated.

getMutualAuthState

  1. public boolean getMutualAuthState( )
Description copied from interface: GSSContext
Returns the state of the mutual authentication option for the context. When issued before context establishment completes or when the isProtReady method returns "false", it returns the desired state, otherwise it will indicate the actual state over the established context.
Specified by:
Returns:
Whether or not the peer is required to authenticate itself to the initiator.

getReplayDetState

  1. public boolean getReplayDetState( )
Description copied from interface: GSSContext
Returns the state of the replay detection option for the context. When issued before context establishment completes or when the isProtReady method returns "false", it returns the desired state, otherwise it will indicate the actual state over the established context.
Specified by:
Returns:
Whether or not replay detection is in effect.

getSequenceDetState

  1. public boolean getSequenceDetState( )
Description copied from interface: GSSContext
Returns the state of the sequence detection option for the context. When issued before context establishment completes or when the isProtReady method returns "false", it returns the desired state, otherwise it will indicate the actual state over the established context.
Specified by:
Returns:
Whether or not sequence detection is in effect.

getAnonymityState

  1. public boolean getAnonymityState( )
Description copied from interface: GSSContext
Returns "true" if this is an anonymous context. When issued before context establishment completes or when the isProtReady method returns "false", it returns the desired state, otherwise it will indicate the actual state over the established context.
Specified by:
Returns:
Whether or not this is an anonymous context.

isTransferable

  1. public boolean isTransferable()
  2. throws GSSException
Description copied from interface: GSSContext
Returns "true" if the context is transferable to other processes through the use of the export method. This call is only valid on fully established contexts.
Specified by:
isTransferable in interface GSSContext
Returns:
Whether or not this context may be transfered using the method.
Throws:
See Also:

isProtReady

  1. public boolean isProtReady()
Description copied from interface: GSSContext
Returns "true" if the per message operations can be applied over the context. Some mechanisms may allow the usage of per-message operations before the context is fully established. This will also indicate that the get methods will return actual context state characteristics instead of the desired ones.
Specified by:
isProtReady in interface GSSContext
Returns:
Whether or not the context is ready for per-message to be used.

getConfState

  1. public boolean getConfState()
Description copied from interface: GSSContext
Returns the confidentiality service state over the context. When issued before context establishment completes or when the isProtReady method returns "false", it returns the desired state, otherwise it will indicate the actual state over the established context.
Specified by:
getConfState in interface GSSContext
Returns:
Whether or not confidentiality services are available on this context.

getIntegState

  1. public boolean getIntegState()
Description copied from interface: GSSContext
Returns the integrity service state over the context. When issued before context establishment completes or when the isProtReady method returns "false", it returns the desired state, otherwise it will indicate the actual state over the established context.
Specified by:
getIntegState in interface GSSContext
Returns:
Whether or not integrity services are available on on this context.

getLifetime

  1. public int getLifetime()
Description copied from interface: GSSContext
Returns the context lifetime in seconds. When issued before context establishment completes or when the isProtReady method returns "false", it returns the desired lifetime, otherwise it will indicate the remaining lifetime for the context.
Specified by:
getLifetime in interface GSSContext
Returns:
The lifetime remaining for this context.

getSrcName

  1. public GSSName getSrcName()
  2. throws GSSException
Description copied from interface: GSSContext
Returns the name of the context initiator. This call is valid only after the context is fully established or the isProtReady method returns "true". It is guaranteed to return an MN.
Specified by:
getSrcName in interface GSSContext
Returns:
The name of the context initiator.
Throws:

getTargName

  1. public GSSName getTargName()
  2. throws GSSException
Description copied from interface: GSSContext
Returns the name of the context target (acceptor). This call is valid only after the context is fully established or the isProtReady method returns "true". It is guaranteed to return an MN.
Specified by:
getTargName in interface GSSContext
Returns:
The name of the context acceptor.
Throws:

getMech

  1. public Oid getMech()
  2. throws GSSException
Description copied from interface: GSSContext
Returns the mechanism oid for this context.
Specified by:
getMech in interface GSSContext
Returns:
The Oid representing the mechamism for this context.
Throws:

getNegMechs

  1. public Oid[] getNegMechs(GSSCredential cred)
  2. throws GSSException
Throws:

getDelegCred

  1. public GSSCredential getDelegCred( )
  2. throws GSSException
Description copied from interface: GSSContext
Returns the delegated credential object on the acceptor's side. This call is only valid on fully established contexts. Call the getCredDelegState method to check for availability of delegated credentials.
Specified by:
getDelegCred in interface GSSContext
Returns:
The credentials delegated to the acceptor.
Throws:

isInitiator

  1. public boolean isInitiator()
  2. throws GSSException
Description copied from interface: GSSContext
Returns "true" if this is the initiator of the context. This call is only valid after the context creation process has started.
Specified by:
isInitiator in interface GSSContext
Returns:
Whether or not the context established between this context and the peer was initiated from this context.
Throws:

toString

  1. public java.lang.String toString( )
Overrides:
toString in class java.lang.Object