Where does Scripture call itself the keys to the kingdom?
In Luke we see the key of knowledge is scripture.
Luke 11:52 Woe unto you, lawyers! for ye have taken away the key of knowledge: ye entered not in yourselves, and them that were entering in ye hindered.
In 2 Thessalonians we see that if they dont obey the word they can be locked out of the church.
2 Thessalonians 3:14 And if any man obey not our word by this epistle, note that man, and have no company with him, that he may be ashamed.
The Apostles, not just Peter, were given the keys of knowledge which would be what people needed to be saved.
Then in Matthew Jesus told them that He had given them the keys of heaven which was the key of knowledge and told them that if someone didnt obey they should have no company with them or not allow them to associate with Christians.
Matthew:16:19 And I will give unto thee the keys of the kingdom of heaven: and whatsoever thou shalt bind on earth shall be bound in heaven: and whatsoever thou shalt loose on earth shall be loosed in heaven.