Called by the context initiator to start the context creation phase and process any tokens generated by the peer's
acceptSecContext
method. This method may return an output token which the application will need to send to the peer for processing by its
acceptSecContext
method. The application can call {@link #isEstablished() isEstablished} to determine if the context establishment phase iscomplete on this side of the context. A return value of
false
from
isEstablished
indicates that more tokens are expected to be supplied to
initSecContext
. Upon completion of the context establishment, the available context options may be queried through the get methods.
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.
Some mechanism providers might require that the caller be granted permission to initiate a security context. A failed permission check might cause a {@link java.lang.SecurityException SecurityException}to be thrown from this method.
@return a byte[] containing the token to be sent to thepeer. null
indicates that no token is generated.
@param inputBuf token generated by the peer. This parameter is ignoredon the first call since no token has been received from the peer.
@param offset the offset within the inputBuf where the token begins.
@param len the length of the token.
@throws GSSException containing the following major error codes: {@link GSSException#DEFECTIVE_TOKEN GSSException.DEFECTIVE_TOKEN}, {@link GSSException#BAD_MIC GSSException.BAD_MIC}, {@link GSSException#NO_CRED GSSException.NO_CRED}, {@link GSSException#CREDENTIALS_EXPIRED GSSException.CREDENTIALS_EXPIRED}, {@link GSSException#BAD_BINDINGS GSSException.BAD_BINDINGS}, {@link GSSException#OLD_TOKEN GSSException.OLD_TOKEN}, {@link GSSException#DUPLICATE_TOKEN GSSException.DUPLICATE_TOKEN}, {@link GSSException#BAD_NAMETYPE GSSException.BAD_NAMETYPE}, {@link GSSException#BAD_MECH GSSException.BAD_MECH}, {@link GSSException#FAILURE GSSException.FAILURE}