jugglingcats / tachograph-reader

Read driver and vehicle card data and convert to a more usable XML format
80 stars 61 forks source link

Validate certitifcate endOfValidity based on newest time we encountered #47

Closed davispuh closed 4 years ago

davispuh commented 5 years ago

Previously we validated Certitifcate.endOfValidity by using current time, but that's not really right approach because we might validate old file signed with old certificate which now is expired but wasn't expired when that file was created.

So this PR implements validating Certitifcate.endOfValidity time against newest (biggest) time we encounter present in file. This way we can see if file doesn't contain any data signed with old/expired certificate. For example signed file where any time is after certificate's endOfValidity will fail validation.