Setting both of private and public key now checks keys' match each other.