Can PKCE be implemented with both server and client generating public and private keys? Is it worth it? What I think is this flow:
- Client generates private and public key
- Client sends public key to server
- Server generates private and public key, generates random secret and encrypts secret with clients public key
- Server sends back to client encrypted secret and servers public key
- Client decrypts secret with his secret key, encrypts it again with servers public key and sends encrypted secret back to server
- Server decrypts secret with his private key and check if generated and now decrypted secret are the same
Am I missing something? Is this bad approach? Is this encryprtion/decryption/generating keys heavy to compute?