Generate certs

this PR contains #463

please only review the last commit.