TsgcWSAPIKeyManager › Methods › IsExpired
Returns True if the key is past its expiry.
function IsExpired(const aKey: string): Boolean;
| Name | Type | Description |
|---|---|---|
aKey | const string | Raw plaintext key to query (re-hashed internally to locate the stored entry). |
True when the key exists and its ExpiresAt is non-zero and already in the past. False when the key is unknown, has no expiry (ExpiresAt = 0), or is still within its validity window. (Boolean)
Pure lookup — does not alter status, fire events or touch the audit log. Use it for read-only introspection (admin dashboard, diagnostic tooling) when you need the expiry state independent of the full ValidateKey pipeline. Note that a key can be past its expiry but still validate until the background sweep flips its status to kksExpired; ValidateKey always re-checks the timestamp when Expiration.EnforceExpiry is True.
if sgcWSAPIKeyManager1.IsExpired(vKey) then
Memo1.Lines.Add('Key expired — trigger renewal reminder.');