Extract cert-svc utility function to separate file