code: @Function
      public static byte[] generateMIC(GSSContext context, MessageProp prop, byte[] message) {
          try {
              // Ensure the default Quality-of-Protection is applied.
              prop.setQOP(0);
  
              byte[] initialToken = context.getMIC(message, 0, message.length, prop);
  
              return getTokenWithLengthPrefix(initialToken);
          } catch (GSSException ex) {
              throw new RuntimeException("Exception generating MIC for message", ex);
          }
      }
docs: Generate a message integrity check for a given received message.
  @param context GSSContext for which a connection has been established to the remote peer
  @param prop the MessageProp used for exchanging messages
  @param message the bytes of the received message
  @return the bytes of the message integrity check (like a checksum) that is
  sent to a peer for verifying that the message was received correctly