Fixed validity calculation. Validity cap honored. Fixed line returns in error messages. Added configurable openssl path