libnick 2024.9.2
A cross-platform base for native Nickvision applications.
Loading...
Searching...
No Matches
Nickvision::Keyring::SystemCredentials Namespace Reference

Functions

std::optional< CredentialgetCredential (const std::string &name)
 Gets a credential from the system's credential manager.
 
std::optional< CredentialaddCredential (const std::string &name)
 Adds a new credential with a random password to the system's credential manager.
 
bool addCredential (const Credential &credential)
 Adds a new credential to the system's credential manager.
 
bool updateCredential (const Credential &credential)
 Updates a credential in the system's credential manager.
 
bool deleteCredential (const std::string &name)
 Deletes a credential from the system's credential manager.
 

Function Documentation

◆ addCredential() [1/2]

bool Nickvision::Keyring::SystemCredentials::addCredential ( const Credential & credential)

Adds a new credential to the system's credential manager.

On Linux, only the name and password of a credential will be stored.

On Windows, all fields of a credential will be stored.

On macOS, all fields of a credential will be stored.

Parameters
credentialThe new credential object
Returns
True if successful, else false

◆ addCredential() [2/2]

std::optional< Credential > Nickvision::Keyring::SystemCredentials::addCredential ( const std::string & name)

Adds a new credential with a random password to the system's credential manager.

Parameters
nameThe name of the credential
Returns
The new Credential object, if successful

◆ deleteCredential()

bool Nickvision::Keyring::SystemCredentials::deleteCredential ( const std::string & name)

Deletes a credential from the system's credential manager.

Parameters
nameThe name of the credential to delete
Returns
True if successful, else false

◆ getCredential()

std::optional< Credential > Nickvision::Keyring::SystemCredentials::getCredential ( const std::string & name)

Gets a credential from the system's credential manager.

Parameters
nameThe name of the credential
Returns
The Credential object, if found

◆ updateCredential()

bool Nickvision::Keyring::SystemCredentials::updateCredential ( const Credential & credential)

Updates a credential in the system's credential manager.

On Linux, only the name and password of a credential will be stored.

On Windows, all fields of a credential will be stored.

On macOS, all fields of a credential will be stored.

Parameters
credentialThe updated credential object
Returns
True if successful, else false