In Matthew 16:19, Yeshua gave Simon Peter the “keys to the kingdom.” The popular folk-image of Saint Peter receiving souls at the gates of heaven derives from this passage. The keys are not literal keys, nor are they keys to the heavenly paradise. The term "Kingdom of Heaven" refers to the Messianic Era, not Heaven. To possess a key is to possess the authority over that which the key unlocks. By giving Simon Peter the “keys to the kingdom,” He invested him with authority to unlock the way to the Messianic Era.
The Prophet Isaiah used similar imagery:
Then I will set the key of the house of David on his shoulder, when he opens no one will shut, when he shuts no one will open. (Isaiah 22:22)
Rabbinic literature interpreted Isaiah 22:22 with reference to the authority of the teachers of Torah:
And this one opens [a discussion of Torah] to fulfill that which is said [in Isaiah 22:22], “When he opens no one will shut, and when he shuts no one will open.” (Sifre on Deuteronomy 32:25)
In that interpretation, the keys to the house of David represent the power to teach authoritatively, to open and close arguments of Torah and make final decisions. Likewise, Yeshua invested his chief disciple with the authority of speaking on His behalf, transmitting and interpreting His teaching, just as the sages transmitted and interpreted the legal codes. Moreover, he gave His Peter (and by extension, all the disciples) administrative and legal authority to apply and interpret His teachings. Just as in the Messianic Era, they will sit upon twelve thrones judging over the twelve tribes, He accorded them the authority to make decisions on behalf of His assembly in the current age.
Entering the Messianic Era is an important theme in the teaching of Yeshua. In the prelude to the sermon on the mount, the Master indicated that only those whose righteousness exceeds that of the scribes and Pharisees will enter the Messianic Era. Those who do not heed His words (i.e., those who do not do the will of His Father in heaven) will find themselves locked outside the kingdom. In that regard, the keys to the kingdom must be the Master’s teaching—the repentance message of the gospel. By giving Peter the keys to the kingdom, He entrusts him with the transmission of His teachings about entering the kingdom.
According to tradition, Mark based his gospel on the teaching of Peter. Scholars believe that the Gospel of Mark is the first of the four Canonical Gospels. In that sense, Peter opened the way to the kingdom by transmitting the teaching of the Master through the written gospels.