add key generation and set permission option