certificate generation/checking

first pass certificate generation