VLC 4.0.0-dev
Loading...
Searching...
No Matches
Collaboration diagram for Keystore public API:

Data Structures

struct  vlc_keystore_entry
 Keystore entry returned by vlc_keystore_find() More...
 

Macros

#define VLC_KEYSTORE_VALUES_INIT(ppsz_values)   memset(ppsz_values, 0, sizeof(const char *) * KEY_MAX)
 
#define vlc_keystore_create(x)   vlc_keystore_create(VLC_OBJECT(x))
 

Enumerations

enum  vlc_keystore_key {
  KEY_PROTOCOL , KEY_USER , KEY_SERVER , KEY_PATH ,
  KEY_PORT , KEY_REALM , KEY_AUTHTYPE , KEY_MAX
}
 List of keys that can be stored via the keystore API. More...
 

Functions

vlc_keystorevlc_keystore_create (vlc_object_t *p_parent)
 Create a keystore object.
 
void vlc_keystore_release (vlc_keystore *p_keystore)
 Release a keystore object.
 
int vlc_keystore_store (vlc_keystore *p_keystore, const char *const ppsz_values[KEY_MAX], const uint8_t *p_secret, ssize_t i_secret_len, const char *psz_label)
 Store a secret associated with a set of key/values.
 
unsigned int vlc_keystore_find (vlc_keystore *p_keystore, const char *const ppsz_values[KEY_MAX], vlc_keystore_entry **pp_entries)
 Find all entries that match a set of key/values.
 
unsigned int vlc_keystore_remove (vlc_keystore *p_keystore, const char *const ppsz_values[KEY_MAX])
 Remove all entries that match a set of key/values.
 
void vlc_keystore_release_entries (vlc_keystore_entry *p_entries, unsigned int i_count)
 Release the list of entries returned by vlc_keystore_find()
 

Detailed Description

Macro Definition Documentation

◆ vlc_keystore_create

#define vlc_keystore_create (   x)    vlc_keystore_create(VLC_OBJECT(x))

◆ VLC_KEYSTORE_VALUES_INIT

#define VLC_KEYSTORE_VALUES_INIT (   ppsz_values)    memset(ppsz_values, 0, sizeof(const char *) * KEY_MAX)

Enumeration Type Documentation

◆ vlc_keystore_key

List of keys that can be stored via the keystore API.

Enumerator
KEY_PROTOCOL 
KEY_USER 
KEY_SERVER 
KEY_PATH 
KEY_PORT 
KEY_REALM 
KEY_AUTHTYPE 
KEY_MAX 

Function Documentation

◆ vlc_keystore_create()

vlc_keystore * vlc_keystore_create ( vlc_object_t p_parent)

Create a keystore object.

A keystore object is persistent across runtime. It is saved on local filesystem via a vlc keystore module (KWallet, SecretService, Apple Keychain Service ...).

Note
to be released with vlc_keystore_release()
Parameters
p_parentthe parent object used to create the keystore object
Returns
a pointer to the keystore object, or NULL in case of error

References keystore_create(), and var_InheritString().

◆ vlc_keystore_find()

unsigned int vlc_keystore_find ( vlc_keystore p_keystore,
const char *const  ppsz_values[KEY_MAX],
vlc_keystore_entry **  pp_entries 
)

Find all entries that match a set of key/values.

Parameters
p_keystorethe keystore instance to look into
ppsz_valuesset of key/values, see vlc_keystore_key, any values can be NULL
pp_entrieslist of found entries. To be released with vlc_keystore_release_entries()
Returns
the number of entries

References vlc_keystore::pf_find.

Referenced by credential_find_keystore().

◆ vlc_keystore_release()

void vlc_keystore_release ( vlc_keystore p_keystore)

Release a keystore object.

References module_unneed, vlc_keystore::p_module, and vlc_object_delete.

Referenced by libvlc_InternalKeystoreClean(), and vlc_credential_clean().

◆ vlc_keystore_release_entries()

void vlc_keystore_release_entries ( vlc_keystore_entry p_entries,
unsigned int  i_count 
)

Release the list of entries returned by vlc_keystore_find()

References vlc_keystore_release_entry().

Referenced by credential_find_keystore(), and vlc_credential_clean().

◆ vlc_keystore_remove()

unsigned int vlc_keystore_remove ( vlc_keystore p_keystore,
const char *const  ppsz_values[KEY_MAX] 
)

Remove all entries that match a set of key/values.

Note
only entries added by VLC can be removed
Parameters
p_keystorethe keystore instance to remove the secrets from
ppsz_valuesset of key/values, see vlc_keystore_key, any values can be NULL
Returns
the number of entries

References vlc_keystore::pf_remove.

◆ vlc_keystore_store()

int vlc_keystore_store ( vlc_keystore p_keystore,
const char *const  ppsz_values[KEY_MAX],
const uint8_t *  p_secret,
ssize_t  i_secret_len,
const char *  psz_label 
)

Store a secret associated with a set of key/values.

Parameters
p_keystorethe keystore to store the secret into
ppsz_valuesset of key/values, see vlc_keystore_key. ppsz_values[KEY_PROTOCOL] and ppsz_values[KEY_SERVER] must be valid strings
p_secretbinary secret or string password
i_secret_lenlength of p_secret. If it's less than 0, then p_secret is assumed to be a '\0' terminated string
psz_labeluser friendly label
Returns
VLC_SUCCESS on success, or VLC_EGENERIC on error

References i_port, KEY_PORT, KEY_PROTOCOL, KEY_SERVER, msg_Err, vlc_keystore::pf_store, psz_label, and VLC_EGENERIC.

Referenced by vlc_credential_store().