Commit Graph

4 Commits

Author SHA1 Message Date
Vadim Zeitlin
2fffbde096 Change wxSecretStore API to allow retrieving the username
The old API didn't make any sense for the most common case when both the
user name and password need to be stored, as it required providing the
user name as input, which couldn't work (but somehow this went
unnoticed for more than a year...).

Fix this by returning the username, and not only the password, from
Load() instead of taking it as parameter and removing this parameter
from Delete() as well.

Also improve the documentation, notably include a simple example of
using this class.

Notice that this is a backwards-incompatible change, but the old API was
really badly broken and didn't appear in 3.1.0 yet, so the breakage is
both unavoidable and, hopefully, shouldn't affect much code.
Nevertheless, a special wxHAS_SECRETSTORE_LOAD_USERNAME symbol is added
to allow testing for it if necessary.
2017-07-17 18:26:20 +02:00
Vadim Zeitlin
4154fbb8a3 Add conversions between wxSecretValue and wxString
This is less secure, but more convenient, than using raw pointers and in most
cases the password will already be stored in a wxString anyhow.
2016-06-04 19:19:15 +02:00
Vadim Zeitlin
1de80a72d9 Refactor wxSecretValue creation
No real changes, just add a new platform-specific NewImpl() method instead of
making wxSecretValue ctor itself platform-specific.

This makes adding other ctors for this class simpler.
2016-06-04 18:46:23 +02:00
Vadim Zeitlin
675d9d779d Add wxSecretStore
Add a new class allowing to store passwords and other sensitive information
using the OS-provided facilities.

Add implementations for all the main platforms, documentation and a new sample
(which contains an ad hoc unit test as the real unit test for this class would
probably be a bad idea as it wouldn't run in non-interactive contexts and
could show OS level dialog boxes if it did).
2016-06-04 18:29:15 +02:00