storing, setting key, authenticating works properly