def ssh_get_mic(self, session_id, gss_kex=False):
self._session_id = session_id<EOL>if not gss_kex:<EOL><INDENT>mic_field = self._ssh_build_mic(<EOL>self._session_id,<EOL>self._username,<EOL>self._service,<EOL>self._auth_method,<EOL>)<EOL>mic_token = self._gss_ctxt.sign(mic_field)<EOL><DEDENT>else:<EOL><INDENT>mic_token = self._gss_srv_ctxt.sign(self._session_id)<EOL><DEDENT>return mic_token<EOL>
Create the MIC token for a SSH2 message.

:param str session_id: The SSH session ID
:param bool gss_kex: Generate the MIC for Key Exchange with SSPI or not
:return: gssapi-with-mic:
         Returns the MIC token from SSPI for the message we created
         with ``_ssh_build_mic``.
         gssapi-keyex:
         Returns the MIC token from SSPI with the SSH session ID as
         message.