Full review (do not merge)

I think 'Unauthorized' exception is misleading here, something like "MalformedCertificate" would be more apt.