mirror of
https://github.com/apple/swift-certificates
synced 2026-11-27 04:54:20 +00:00
Currently, certificate verification is severely bottlenecked on expiry checking. This bottleneck is almost entirely caused by converting Time objects into Date objects via DateComponents. We can reduce the cost of this by doing fewer transformations. Instead of converting all the Time objects to Dates, we can convert a Date to a GeneralizedTime and then do all comparisons in GeneralizedTime space. This vastly reduces the cost of cert validation.