Add much more versatile and robust version of gencert utility