keepFreshGrant

open suspend fun keepFreshGrant(grant: Grant)

Keeps grant as keepGrant does, with one exception: a held grant from the same issuer for the same scope dated more than GrantTrust.CLOCK_SKEW_ALLOWANCE_MILLIS after grant gives way to it, although grant is older (identity Task 2.5, #3221).

Only for a grant its issuer has just handed this device in answer to the device's own latest Hello: the pass on a room's direct Welcome, which names that Hello, so it cannot be a replay. grant's date is then the issuer's clock now, and the issuer would refuse the held grant as GrantVerdict.NotYetValid: a pass issued while that clock ran ahead. Kept, it would shut out every fresh pass until its date came near, and the device would be vetted on every return meanwhile. Through keepGrant a grant names no Hello, so nothing tells it from a replayed or late copy, and the held grant stays.

The default keeps through keepGrant, so a store that does not override this keeps the newest grant only, the safe direction: its device is vetted until the bad pass's date comes near. Every store kuilt ships overrides it.