def verify_mic(self, message, mic, supplementary=False):
if not (self.flags & C.GSS_C_INTEG_FLAG):<EOL><INDENT>raise GSSException("<STR_LIT>")<EOL><DEDENT>if not (self.established or (self.flags & C.GSS_C_PROT_READY_FLAG)):<EOL><INDENT>raise GSSException("<STR_LIT>")<EOL><DEDENT>minor_status = ffi.new('<STR_LIT>')<EOL>message_buffer = ffi.new('<STR_LIT>')<EOL>message_buffer[<NUM_LIT:0>].length = len(message)<EOL>c_str_message = ffi.new('<STR_LIT>', message)<EOL>message_buffer[<NUM_LIT:0>].value = c_str_message<EOL>mic_buffer = ffi.new('<STR_LIT>')<EOL>mic_buffer[<NUM_LIT:0>].length = len(mic)<EOL>c_str_mic = ffi.new('<STR_LIT>', mic)<EOL>mic_buffer[<NUM_LIT:0>].value = c_str_mic<EOL>qop_state = ffi.new('<STR_LIT>')<EOL>retval = C.gss_verify_mic(<EOL>minor_status,<EOL>self._ctx[<NUM_LIT:0>],<EOL>message_buffer,<EOL>mic_buffer,<EOL>qop_state<EOL>)<EOL>if GSS_ERROR(retval):<EOL><INDENT>if minor_status[<NUM_LIT:0>] and self.mech_type:<EOL><INDENT>raise _exception_for_status(retval, minor_status[<NUM_LIT:0>], self.mech_type)<EOL><DEDENT>else:<EOL><INDENT>raise _exception_for_status(retval, minor_status[<NUM_LIT:0>])<EOL><DEDENT><DEDENT>supp_bits = _status_bits(retval)<EOL>if supplementary:<EOL><INDENT>return qop_state[<NUM_LIT:0>], supp_bits<EOL><DEDENT>elif len(supp_bits) > <NUM_LIT:0>:<EOL><INDENT>raise _exception_for_status(retval, minor_status[<NUM_LIT:0>])<EOL><DEDENT>else:<EOL><INDENT>return qop_state[<NUM_LIT:0>]<EOL><DEDENT>
Takes a message integrity code (MIC) that has been generated by the peer application for a
given message, and verifies it against a message, using this security context's
cryptographic keys.

The `supplementary` parameter determines how this method deals with replayed, unsequential,
too-old or missing tokens, as follows:

If the `supplementary` parameter is False (the default), and if a replayed or otherwise
out-of-sequence token is detected, this method raises a :exc:`~gssapi.error.GSSCException`.
If no replay or out-of-sequence token is detected, this method does not raise an exception
and returns the ``qop_state`` only.

If `supplementary` is True, instead of raising an exception when a replayed or
out-of-sequence token is detected, this method returns a tuple
``(qop_state, supplementary_info)`` where ``supplementary_info`` is a tuple containing zero
or more of the constants :const:`~gssapi.S_DUPLICATE_TOKEN`, :const:`~gssapi.S_OLD_TOKEN`,
:const:`~gssapi.S_UNSEQ_TOKEN` and :const:`~gssapi.S_GAP_TOKEN`. The supplementary info
tells the caller whether a replayed or out-of-sequence message was detected. The caller
must check this and decide how to handle the message if any of the flags are set. For a
reference to the meaning of the flags, check
`RFC 2744 Section 3.9.1 <http://tools.ietf.org/html/rfc2744#section-3.9.1>` for the
corresponding GSS_S_OLD_TOKEN, etc, constants.

:param message: The message the MIC was calculated for
:type message: bytes
:param mic: The MIC calculated by the peer
:type mic: bytes
:param supplementary: Whether to also return supplementary info.
:type supplementary: bool
:returns: ``qop_state`` if `supplementary` is False, or ``(qop_state,
    supplementary_info)`` if `supplementary` is True.
:raises: :exc:`~gssapi.error.GSSException` if :attr:`integrity_negotiated` is false, or
    :exc:`~gssapi.error.GSSCException` if the verification fails indicating the message was
    modified, replayed or out-of-sequence.