more templating for dealing with certs in different contexts #1762