John Howie, The Scots Worthies, p. 453:
From the last sermon which [Hugh McKail] delivered at that time, in the High Church of Edinburgh, from Song i.7., may be dated the commencement of his sufferings. In this sermon he fearlessly showed that it was no new thing for the church to be involved in persecution; and, amplifying the subject, he said, -- a Pharaoh on the throne, a Haman in the state, and a Judas in the church, had done the work in former times; and although in his allusion to Haman and Judas he made no application, yet [Archbishop James] Sharp and [John Maitland, Duke of] Lauderdale thought their portraits had been very accurately drawn; and therefore M'Kail was singled out as a very proper person to be put to silence.
The Coltness Collections, p. 47, add that he said:
Let Pharoah, let Haman, let Judas, let Herod, let each of them speak their expeience of God's faithfulness! Let all that have ears to hear, and hearing acknowledge, that these that made themselves remarkable for persecution God stigmatized by his judgments.
Following this sermon, McKail became a hunted man, and was forced to flee to Holland for 2-3 years. After his return, though he had little involvement in the Pentland Rising, upon his capture, he was made an example, and suffered excruciatingly under the Boot, before uttering his famous dying words on the scaffold on December 22, 1666:
Farewell father and mother, friends and relations; -- Farewell the world and all delights; -- Farewell meat and drink; -- Farewell sun, moon, and stars; -- Welcome God and Father; -- Welcome sweet Jesus Christ, the Mediator of the new covenant; -- Welcome blessed Spirit of grace, and God of all consolation; -- Welcome glory; -- Welcome eternal life; -- and, Welcome death!
Although not all applications are precise, the following are the leading candidates corresponding to the references made, and it is well known that Archbishop Sharp never forgave nor forgot that 1662 sermon and personally ensured that McKail paid the price.
Pharoah -- King Charles II (subscribed the National Covenant of Scotland and the Solemn League and Covenant at Spey on June 23, 1650, and at Scone on January 1, 1651, and after the Restoration had copies of the latter burned by the hangman all over England on May 22, 1661). He was the king during the Killing Time.
Haman -- Commissioner John Middleton, Earl of Middleton (served the king's interests in Scotland, appointed commander-in-chief of the troops in Scotland and Lord High Commissioner to the Scottish Parliament); John Maitland, Duke of Lauderdale (Maitland was a former Covenanter and served as a member of the Westminster Assembly, but switched loyalties and ingratiated himself with King Charles, becoming his close confidant, a member of the Cabal Ministry, and a persecutor of the Covenanters).
Judas -- Archbishop James Sharp (once a leader of the Scottish Resolutioners, during his negotiations with King Charles, he secretly switched sides, forsaking the Covenanters for preferment by the king, he adopted a policy of persecution towards his former friends). He survived one assassination attempt in 1668, but was killed by a group of Covenanters in 1679.
Herod -- James, Duke of York (brother of King Charles II, he later became King James II during the final phase of the Killing Time until he was deposed by the Glorious Revolution).