Only re-write identity data when changed

Instead of deleting everything and re-writing the config/secret key is changed only if updated (as per #733)

Created by  finchie  on November 26, 2022
DOEG3V7UAVYBKLIPHSNWWONYDORKNJEZL2LD4EWGGUDB2SK6BOFQC
Change contents