def ssh_init_sec_context(<EOL>self, target, desired_mech=None, username=None, recv_token=None<EOL>):
from pyasn1.codec.der import decoder<EOL>self._username = username<EOL>self._gss_host = target<EOL>error = <NUM_LIT:0><EOL>targ_name = "<STR_LIT>" + self._gss_host<EOL>if desired_mech is not None:<EOL><INDENT>mech, __ = decoder.decode(desired_mech)<EOL>if mech.__str__() != self._krb5_mech:<EOL><INDENT>raise SSHException("<STR_LIT>")<EOL><DEDENT><DEDENT>try:<EOL><INDENT>if recv_token is None:<EOL><INDENT>self._gss_ctxt = sspi.ClientAuth(<EOL>"<STR_LIT>", scflags=self._gss_flags, targetspn=targ_name<EOL>)<EOL><DEDENT>error, token = self._gss_ctxt.authorize(recv_token)<EOL>token = token[<NUM_LIT:0>].Buffer<EOL><DEDENT>except pywintypes.error as e:<EOL><INDENT>e.strerror += "<STR_LIT>".format(e, self._gss_host)<EOL>raise<EOL><DEDENT>if error == <NUM_LIT:0>:<EOL><INDENT>"""<STR_LIT>"""<EOL>self._gss_ctxt_status = True<EOL>token = None<EOL>"""<STR_LIT>"""<EOL><DEDENT>return token<EOL>
Initialize a SSPI context.

:param str username: The name of the user who attempts to login
:param str target: The FQDN of the target to connect to
:param str desired_mech: The negotiated SSPI mechanism
                         ("pseudo negotiated" mechanism, because we
                         support just the krb5 mechanism :-))
:param recv_token: The SSPI token received from the Server
:raises:
    `.SSHException` -- Is raised if the desired mechanism of the client
    is not supported
:return: A ``String`` if the SSPI has returned a token or ``None`` if
         no token was returned