DRY generation and output of csr/cert