1 // Copyright 2020 The Chromium Authors. All rights reserved. 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 SERVICES_NETWORK_TRUST_TOKENS_TRUST_TOKEN_KEY_FILTERING_H_ 6 #define SERVICES_NETWORK_TRUST_TOKENS_TRUST_TOKEN_KEY_FILTERING_H_ 7 8 #include <vector> 9 10 #include "services/network/public/mojom/trust_tokens.mojom.h" 11 12 namespace network { 13 14 // Mutates |keys| to contain the |num_keys_to_keep| many soonest-to-expire (in 15 // particular, not yet expired) keys. If there are fewer than |num_keys_to_keep| 16 // such keys, mutates |keys| to contain all such keys. Breaks ties 17 // determistically based on key body. 18 // 19 // (A key has "expired" means its expiry time is not in the future.) 20 // 21 // |keys|'s entries must not be null. 22 void RetainSoonestToExpireTrustTokenKeys( 23 std::vector<mojom::TrustTokenVerificationKeyPtr>* keys, 24 size_t num_keys_to_keep); 25 26 } // namespace network 27 28 #endif // SERVICES_NETWORK_TRUST_TOKENS_TRUST_TOKEN_KEY_FILTERING_H_ 29