[Gambas-user] gb.Desktop and Gnome Keyring

Sebi Kul sebikul at ...626...
Thu May 26 03:36:39 CEST 2011


On mié 25 may 2011 21:21:24 ART, Benoît Minisini wrote:
>> Hi!
>>
>> I wanted to know how is the keyring accessed using Gambas. I found on
>> the gb.Desktop component a Gambas class (_DesktopPasswords) and a C
>> component when the desktop enviroment is Gnome. but i couldn't find any
>> info regarding it's usage. The _DesktopPasswords is exported as a static
>> class, but it isn't loaded outside the component, the same with the C
>> component. How could i do to be able to get and set passwords?
>>
>> Also, will the component ask the user to unlock the keyring or will it
>> fail (with an error)? and how is the name of the key defined?
>>
>> Thanks all!
> 
> To store a password:
> 
> Desktop.Passwords[Key] = Password
> 
> "Key" is a way to identify your password inside the password storage system.
> 
> To read a password:
> 
> Password = Desktop.Passwords[Key]
> 
> What happens exactly depends on the password storage system. As I don't use 
> Gnome, you will tell me!
> 
> The Gnome keyring is accessed through the gb.desktop.gnome hidden component. 
> Look at the source in ./gb.desktop/src/gnome to see which code is executed 
> exactly to access the keyring.
> 
> Regards,

It works flawlessly, and if the keyring is locked it asks you to enter 
it's password.

I've made an example to test this before including it into my project, 
if you would like to add it to the examples please let me know.

Thanks a lot!




More information about the User mailing list