Moved certificate generation functions to a separate file