failure and freeing up memory if a failure occurs. PR:620
certificate: currently this includes trust settings and a "friendly name".