mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-08-06 09:26:52 +01:00
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9c2eebc4-dcd5-4b85-8113-90772d818900
18 lines
610 B
AL
18 lines
610 B
AL
codeunit 50217 "Sec Sample SetEncrypted Good"
|
|
{
|
|
internal procedure StoreApiKey(ApiKeyValue: SecretText)
|
|
var
|
|
StoreApiKeyFailedErr: Label 'The API key could not be stored.';
|
|
begin
|
|
if not IsolatedStorage.SetEncrypted('ApiKey', ApiKeyValue, DataScope::Module) then
|
|
Error(StoreApiKeyFailedErr);
|
|
end;
|
|
|
|
local procedure ReadApiKey(var ApiKey: SecretText): Boolean
|
|
begin
|
|
if not IsolatedStorage.Contains('ApiKey', DataScope::Module) then
|
|
exit(false);
|
|
IsolatedStorage.Get('ApiKey', DataScope::Module, ApiKey);
|
|
exit(true);
|
|
end;
|
|
}
|