Skip to content

sailfishos/libsailfishkeyprovider

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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