And when he was cast into prison there, God brought him out, and at the same time brought him into favour and estimation, for deep wisdom, with Pharaoh the king of Egypt: and he intrusted the affairs of his whole household, yea and the whole kingdom, to his managery.