[WIP] Implement certificate functions