1 // Copyright 2019 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef NET_CERT_PKI_REVOCATION_UTIL_H_ 6 #define NET_CERT_PKI_REVOCATION_UTIL_H_ 7 8 #include "net/base/net_export.h" 9 #include "third_party/abseil-cpp/absl/types/optional.h" 10 11 #include <cstdint> 12 13 namespace net { 14 15 namespace der { 16 struct GeneralizedTime; 17 } 18 19 // Returns true if a revocation status with |this_update| field and potentially 20 // a |next_update| field, is valid at POSIX time |verify_time_epoch_seconds| and 21 // not older than |max_age_seconds| seconds, if specified. Expressed 22 // differently, returns true if |this_update <= verify_time < next_update|, and 23 // |this_update >= verify_time - max_age|. 24 [[nodiscard]] NET_EXPORT_PRIVATE bool CheckRevocationDateValid( 25 const der::GeneralizedTime& this_update, 26 const der::GeneralizedTime* next_update, 27 int64_t verify_time_epoch_seconds, 28 absl::optional<int64_t> max_age_seconds); 29 30 } // namespace net 31 32 #endif // NET_CERT_PKI_REVOCATION_UTIL_H_ 33