Update the code in regard to the code review

The change on the "javax.servlet.request.X509Certificate" has been reversed and
all unnecessary assertNotNull() method calls have been removed. Exception
handling was moved to method signatures (as opposed to try-catch statements)
for increased clarity and newlines were added where needed.