generate_cert function done and checked