security: Fix bug in selfSign to sign the signed portion of the certificate.