Serializing and deserializing Secrets in the standard JSON format