In Matthew 18:13ff, Jesus presents a very important question to these disciples. He says, "Whom do men say that I the Son of man am?" The disciples said that some people are saying that you are John the Baptizer; some people say that you are Elijah or Jeremiah or one of the prophets. Jesus then asks the disciples, "But whom say ye that I am." Peter speaks up and says, "Thou art the Christ, the Son of the living God." Jesus response to this question is revealing. He says that this confession that Peter made came from God and that based upon this confession Jesus will build His church. It is within this context of Peter's confession and the promise to build His church that Jesus says, "And I will give unto thee the keys of the kingdom of heaven" (Matthew 16:19).
The metaphor that Jesus uses both to describe the church and the kingdom here is one of a building. Jesus said that he was going to build the church and give the keys of the kingdom. Buildings are both built and have keys. We would use the same language in regard to a house or an office building today. The process of building involves planning, construction, and finishing. When the building is complete, the builder gives the keys to those who are going to reside therein so that they can open and close the door to the building. Jesus is using a similar metaphor here regarding the church. The design of the church, the planning for the church, and the purpose of the church were all put together by Jesus--he is the builder. When Jesus died on the cross, he became the head and Savior of the church according to Ephesians 5:23-27. This meant that after his death, everything was ready for people to start entering into the church. But to enter into the church, they needed the keys to open the door. Jesus told Peter that He would give him the keys to open the doors to Jesus' building--His church--the kingdom of heaven. These keys were given to Peter in Acts 2.
In Acts chapter 2, Peter preaches the first gospel sermon to those who had crucified Jesus. He proclaims in this sermon that Jesus was resurrected from the dead and that those standing around were guilty of crucifying the Son of God. During the message which Peter was delivering to them, the hearers speak up and say, "Men and brethren what shall we do?" (Acts 2:37). Peter then tells them that they need to repent and be baptized for the remission of their sins (Acts 2:38). We see in Acts 2:41 that those who gladly received the word were baptized. The result of their baptism was that they were added to the disciples (Acts 2:41). And we see in Acts 2:47 that this meant when they were saved (through obedience) they were added to the church. The commands that Peter spoke are the keys to the kingdom. These commands are the terms of entrance into the church. Peter's preaching of the gospel resulted in guilty individuals hearing, being baptized, and having their sins forgiven. Through their obedience they were then ushered into the church that Jesus promised he would build, thus opening the door to all who would believe and obey forever.
Those same keys are entrusted to members of the church today and using the same plan which Peter preached in Acts 2, the same results can occur in the lives and hearts of men and women. The world today is just as guilty of crucifying the Son of because it was for the sins of the world that Jesus died. Those who are in their sins this hour stand guilty before God of this ultimate crime. The only recourse of action that they have to be reconciled to God today is to use these same keys to enter into the kingdom of heaven. When a person hears the gospel of Jesus and obeys the commands that are contained therein to repent and be baptized, they will be added to the church just as those who first heard the preaching of Peter. Peter used the keys that were given to him to unlock the door of the kingdom. The door of the kingdom stands opened wide for all who would use those same keys.