https://gitlab.com/stcarrez/ada-libsecret
Author:Apache-2.0
Version:1.0.0
Alire CI: Dependencies:No dependents.
Badge:
The libsecret is a library for storing and retrieving passwords and others secrets. The library uses the Secret Service API provided by Gnome Keyring or KDE Wallet. This library provides an Ada binding to the Secret Service API.
You can store a secret by using the following code extract:
with Secret.Services;
with Secret.Attributes;
with Secret.Values;
...
Service : Secret.Services.Service_Type;
List : Secret.Attributes.Map;
Value : Secret.Values.Secret_Type;
...
Service.Initialize;
List.Insert ("secret identification key", "secret identification value");
Value := Secret.Values.Create ("the-secret-to-store");
Service.Store (List, "The secret label (for the keyring manager)", Value);
And you will retrieve it with:
Value := Service.Lookup (List);
if not Value.Is_Null then
Ada.Text_IO.Put_Line (Value.Get_Value);
end if;