22#include <libsecret/secret.h>
30 "org.kicad.kicad", SECRET_SCHEMA_NONE,
32 {
"service", SECRET_SCHEMA_ATTRIBUTE_STRING },
33 {
"key", SECRET_SCHEMA_ATTRIBUTE_STRING },
34 {
nullptr, SECRET_SCHEMA_ATTRIBUTE_STRING }
38 bool StoreSecret(
const wxString& aService,
const wxString& aKey,
const wxString& aSecret )
40 GError* error =
nullptr;
41 wxString display = aService +
":" + aKey;
43 secret_password_store_sync( &
schema,
44 SECRET_COLLECTION_DEFAULT,
49 "service", aService.ToStdString().c_str(),
50 "key", aKey.ToStdString().c_str(),
55 g_error_free( error );
62 bool GetSecret(
const wxString& aService,
const wxString& aKey, wxString& aSecret )
64 GError* error =
nullptr;
65 gchar* secret = secret_password_lookup_sync( &
schema,
68 "service", aService.ToStdString().c_str(),
69 "key", aKey.ToStdString().c_str(),
74 g_error_free( error );