Remove carriage return ('\r') to avoid problems on API representation.

* Move certificate validation to a custom model field.
* Clean certificate and pubkey form fields.