I'm working on a specific (hypothetical) situation, where I have two client machines attempting to perform a public key exchange, via a server. There's no possibility for a direct connection between the two clients, as the exchange is asynchronous.
The server cannot be completely trusted. As it is facilitating the key exchange, there is the possibility that it substitutes the client key with one it controls.
Is there any way this can be at-minimum detected by the receiving client, or better yet, actively protected against or worked around? Techniques such as the Diffie–Hellman key exchange don't seem to work here, as the channel is controlled by the entity we're trying to protect against (i.e. the server).