Validate the domain that's extracted from the cert email

As in #21, this patch includes a copy of the validateAuthority function introduced in #10 and so it will need to be refactored once/if both of these patches are merged.