refactor the processCertificate
Half of Test implementation