Added code to retrieve certificate.