API Reference
StreamSec.DSI.KeyStorageMemory
In-Memory Key Storage Unit
Classes, interfaces and records
classTstCustomKeyStorageMemory
inherits from TstAbstractKeyStorageMultiFormat
constructor Create(AOwner: TComponent); override;
Standard component constructor; sets up the empty (sorted) in-memory entry map. An application normally just drops the component or creates it and then uses ImportBytes plus Enabled, rather than calling this directly.
» member page
destructor Destroy; override;
Frees the component and securely clears every stored entry (each backing tSecureMemoryStream is zeroed on free), so key bytes never linger in memory.
» member page
procedure ImportBytes(const aName: string; const aData: tBytes);
Store a raw, already-formatted key/cert blob (e.g. an individual entry pulled out of a PFX) under aName. If the store is enabled, the in-memory key list is refreshed so the new entry is immediately resolvable.
» member page
procedure Clear;
Drop all in-memory entries (and, if enabled, the cached key list).
» member page
function EntryCount: Integer;
Number of raw blobs currently held (one per name passed to ImportBytes or saved by the key manager). Note this counts stored entries, not the number of resolvable keys -- a single PFX blob can expand into several key-list entries; use it for diagnostics or to check whether anything was imported.
» member page
property PrivateKeyPassword;
Password used to decrypt password-protected private-key blobs imported into this store (e.g. an encrypted PKCS#8 or PFX entry). Inherited from the key manager base; set it before Enabled so PopulateKeyList can decode the keys.
» member page
property OnPassword;
Fired when a stored blob needs a password and PrivateKeyPassword was not set (or was wrong); an application handles this to prompt the user or supply a stored credential on demand instead of hard-coding PrivateKeyPassword.
» member page
inherits from TstCustomKeyStorageMemory
property OnSuggestMemKeyFormat;
Handle this to narrow the key formats attempted when a named in-memory blob is decoded, e.g. when a name maps to one known format and you want to skip the trial-and-error over every registered format. See tGetKeyFormatsMemEvent.
» member page
property OnGetNewKeyName;
Handle this to assign the name under which a key the manager saves into this store is filed; leave it unassigned to get an auto-generated sequential name ('mem1', 'mem2', ...). See tGetNewKeyNameEvent.
» member page
classtKeyStorageMemory
inherits from TstCustomKeyStorageMemory
class function Description: string; override;
Returns the value of rsUseKeyStorageMemory.
property OnSuggestMemKeyFormat;
property OnGetNewKeyName;
Types (enumerations, sets, aliases)
Lets the application narrow the key formats tried when loading a named in-memory entry (analogous to TstCustomKeyStorageFiles.OnSuggestFileKeyFormat).
tGetKeyFormatsMemEvent = procedure (Sender : TObject;
const aKeyName : string;
aFormats : IInterfaceList) of object;
proctGetNewKeyNameEvent
Lets the application name a newly stored key (analogous to OnGetNewKeyFileName). If unassigned, a sequential name is generated.
tGetNewKeyNameEvent = procedure (Sender : TObject;
const aKey : iUnknown;
var aKeyName : string) of object;