Added more information (not_valid_before, not_valid_after, serial). Refactored some code.