Added checks for not well defined expiration date.

As in title. I had to add a method to cert though :(