cert-crypto: add test certificate generation function