Added certificate generation code.