Finally writing .key files correctly. Now to debug .crt files.