TsgcWSAPIKeyManagerProperties › Generation

Generation Property

Controls how plaintext keys are built by IssueKey: KeyPrefix, KeyLength, Charset and optional checksum.

Syntax

property Generation: TsgcAPIKeyGeneration read FGeneration write SetGeneration;

Default Value

Remarks

Controls how the plaintext key string is built by IssueKey. The key is a KeyPrefix followed by KeyLength random characters drawn from Charset (defaults to URL-safe alphanumerics when empty). When IncludeChecksum is True a short checksum suffix is appended so obviously malformed keys can be rejected cheaply before a hash lookup. Use a branded prefix such as sgc_live_ / sgc_test_ so support staff and log scrubbers can recognise which environment a leaked key belongs to. The generated plaintext is hashed according to the Hashing group before being persisted.

Example

// Branded production keys: sgc_live_aB3...
sgcWSAPIKeyManager1.Generation.Enabled := True;
sgcWSAPIKeyManager1.Generation.KeyPrefix := 'sgc_live_';
sgcWSAPIKeyManager1.Generation.KeyLength := 32;
sgcWSAPIKeyManager1.Generation.IncludeChecksum := True;

Back to Properties