Switch logic so if pub_key is undef notify that no key is set