No description
  • C 91.8%
  • C++ 7.5%
  • QMake 0.7%
Find a file
Matti Lehtimäki dd00649085
Merge pull request #2 from sailfishos/jb63045
Fix build with gcc 15. Fix SailfishKeyProvider_ini_sections and SailfishKeyProvider_ini_keys
2025-05-26 22:57:49 +03:00
lib [sailfishkeyprovider] Fix SailfishKeyProvider_ini_sections and SailfishKeyProvider_ini_keys 2025-05-25 00:14:33 +03:00
rpm [sailfishkeyprovider] Fix build with gcc 15. JB#63045 2025-05-25 00:14:38 +03:00
src [tooling] Add keygen utility. Contributes to MER#1468 2016-01-22 11:06:50 +10:00
tests [sailfishkeyprovider] Fix build with gcc 15. JB#63045 2025-05-25 00:14:38 +03:00
libsailfishkeyprovider.pro [sailfishkeyprovider] Build subdirs as ordered. JB#55991 2021-11-22 16:11:49 +02:00
license.lgpl [libsailfishkeyprovider] Add automated test definition 2013-10-03 13:21:00 +10:00
README [tooling] Add keygen utility. Contributes to MER#1468 2016-01-22 11:06:50 +10:00

Provides a class which can provide decoded keys to client applications.
These keys may be useful for OAuth2 sign-on process flows, for example.

Note that this does NOT provide security; it exists to separate the
provision of encoded keys from client application code.  The static
stored keys should be provided as:

/usr/share/libsailfishkeyprovider/storedkeys.ini

Example of usage:

@
#include <sailfishkeyprovider.h>

char *buf = NULL;
int success = SailfishKeyProvider_storedKey(
                "twitter",
                "twitter-sync",
                "consumer_key",
                &buf);
/* use key in OAuth2 flow */
free(buf);
@

Parameters are:
    - provider name (from /usr/share/accounts/providers/ description file)
    - service name (from /usr/share/accounts/services/ description file)
    - key name (required for OAuth2 flow)


===================
GENERATING NEW KEYS
===================

For your added convenience of not having to edit and recompile unit tests
just to generate some encrypted keys, this now builds an utility:

    $ sailfish-keyprovider-keygen xor Secret ClientID
                                   ^    ^        ^
                                  /      \        \
                             method   encryption   \
                                         key     value to be obfuscated

    generate_keys:
        input: ClientID
        encoded: 0 EAkKFwsAGiE=
        roundtrip: 0 ClientID