TsgcWSAPIKeyManagerMethods › IsExpired

IsExpired Method

Returns True if the key is past its expiry.

Syntax

function IsExpired(const aKey: string): Boolean;

Parameters

NameTypeDescription
aKeyconst stringRaw plaintext key to query (re-hashed internally to locate the stored entry).

Return Value

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)

Remarks

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.

Example

if sgcWSAPIKeyManager1.IsExpired(vKey) then
  Memo1.Lines.Add('Key expired — trigger renewal reminder.');

Back to Methods