I'm trying to code up a encrypted communication program. Originally I was thinking that I would use public key cryptography and then I would keep the public keys in a database where users could query the database for another user's public key to encrypt their message. However this allows me to read their message if I ever sent them my public key instead of the their intended recipient's public key.
Is it possible to have forward secrecy if they grab the public key from the central server, which I control? It seems to me that if you use some forward secrecy algorithms like STS I would still be able to send both users my public key and they would be none the wiser.