Pseudepigrapha

Testament of Solomon 1

5 Now when I Solomon heard this, I entered the Temple of God, and prayed with all my soul, night and day, that the demon might be delivered into my hands, and that I might gain authority over him. And it came about through my prayer that grace was given to me from the Lord Sabaoth by Michael his archangel. [He brought me] a little ring, having a seal consisting of an engraved stone, and said to me: "Take, O Solomon, king, son of David, the gift which the Lord God has sent thee, the highest Sabaoth. With it thou shalt lock up all demons of the earth, male and female; and with their help thou shalt build up Jerusalem. [But] thou [must] wear this seal of God. And this engraving of the seal of the ring sent thee is a Pentalpha."

Date: 100-900 C.E.
* Dates are based on scholarly estimates
Rabbinic

Gittin 68a

Babylonian Talmud

Solomon said to them: Where is it found? They said to him: Bring a male demon and a female demon and torment them together. It is possible that they know where, and due to the suffering they will reveal the place to you. Solomon brought a male demon and a female demon and tormented them together, and they said: We do not know where to find the shamir. Perhaps Ashmedai, king of the demons, knows. Solomon said to them: Where is Ashmedai? They said to him: He is on such-and-such a mountain. He has dug a pit for himself there, and filled it with water, and covered it with a rock, and sealed it with his seal. And every day he ascends to Heaven and studies in the heavenly study hall and he descends to the earth and studies in the earthly study hall. And he comes and checks his seal to ensure that nobody has entered his pit, and then he uncovers it and drinks from the water in the pit. And then he covers it and seals it again and goes. Solomon sent for Benayahu, son of Jehoiada, a member of the royal entourage, and gave him a chain onto which a sacred name of God was carved, and a ring onto which a sacred name of God was carved, and fleeces of wool and wineskins of wine. What did Benayahu do? He went and dug a pit lower down the mountain, below the pit dug by Ashmedai, drained the water, and plugged it with the fleeces of wool so that Ashmedai’s pit was emptied. And he dug a pit higher up the mountain, above Ashmedai’s pit. And he poured the wine into it so that the wine filled Ashmedai’s pit, and he plugged the lower and upper pits that he dug. He climbed up and sat in a tree.

Date: 450-550 C.E.
* Dates are based on scholarly estimates