update credential generator to check if a certificate exists