Liblinphone
5.3.0
|
Object holding authentication information. More...
#include <auth_info.hh>
Public Member Functions | |
LINPHONECXX_PUBLIC | AuthInfo (void *ptr, bool takeRef=true) |
LINPHONECXX_PUBLIC _LinphoneAuthInfo * | cPtr () |
LINPHONECXX_PUBLIC std::string | getAlgorithm () const |
Gets the algorithm. More... | |
LINPHONECXX_PUBLIC void | setAlgorithm (const std::string &algorithm) |
Sets the algorithm to use. More... | |
LINPHONECXX_PUBLIC std::list< std::string > | getAvailableAlgorithms () const |
Gets all available algorithms. More... | |
LINPHONECXX_PUBLIC void | setAvailableAlgorithms (const std::list< std::string > &algorithms) |
Sets the available algorithms list without testing unicity. More... | |
LINPHONECXX_PUBLIC std::string | getDomain () const |
Gets the domain. More... | |
LINPHONECXX_PUBLIC void | setDomain (const std::string &domain) |
Sets the domain for which this authentication is valid. More... | |
LINPHONECXX_PUBLIC std::string | getHa1 () const |
Gets the ha1. More... | |
LINPHONECXX_PUBLIC void | setHa1 (const std::string &ha1) |
Sets the ha1. More... | |
LINPHONECXX_PUBLIC std::string | getPassword () const |
Gets the password. More... | |
LINPHONECXX_PUBLIC void | setPassword (const std::string &password) |
Sets the password. More... | |
LINPHONECXX_PUBLIC std::string | getRealm () const |
Gets the realm. More... | |
LINPHONECXX_PUBLIC void | setRealm (const std::string &realm) |
Sets the realm. More... | |
LINPHONECXX_PUBLIC std::string | getTlsCert () const |
Gets the TLS certificate. More... | |
LINPHONECXX_PUBLIC void | setTlsCert (const std::string &tlsCert) |
Sets the TLS certificate. More... | |
LINPHONECXX_PUBLIC std::string | getTlsCertPath () const |
Gets the TLS certificate path. More... | |
LINPHONECXX_PUBLIC void | setTlsCertPath (const std::string &tlsCertPath) |
Sets the TLS certificate path. More... | |
LINPHONECXX_PUBLIC std::string | getTlsKey () const |
Gets the TLS key. More... | |
LINPHONECXX_PUBLIC void | setTlsKey (const std::string &tlsKey) |
Sets the TLS key. More... | |
LINPHONECXX_PUBLIC std::string | getTlsKeyPath () const |
Gets the TLS key path. More... | |
LINPHONECXX_PUBLIC void | setTlsKeyPath (const std::string &tlsKeyPath) |
Sets the TLS key path. More... | |
LINPHONECXX_PUBLIC std::string | getUserid () const |
Gets the user id. More... | |
LINPHONECXX_PUBLIC void | setUserid (const std::string &userId) |
Sets the user ID. More... | |
LINPHONECXX_PUBLIC std::string | getUsername () const |
Gets the username. More... | |
LINPHONECXX_PUBLIC void | setUsername (const std::string &username) |
Sets the username. More... | |
LINPHONECXX_PUBLIC void | addAvailableAlgorithm (const std::string &algorithm) |
Add an unique algorithm in the the available algorithms list : Algorithms that already exist will not be added. More... | |
LINPHONECXX_PUBLIC void | clearAvailableAlgorithms () |
Remove all algorithms from the available algorithms list. | |
LINPHONECXX_PUBLIC std::shared_ptr< linphone::AuthInfo > | clone () const |
Instantiates a new auth info with values from source. More... | |
LINPHONECXX_PUBLIC bool | isEqualButAlgorithms (const std::shared_ptr< const linphone::AuthInfo > &authInfo2) const |
Check if Authinfos are the same without taking account algorithms. More... | |
Object holding authentication information.
In most case, authentication information consists of a username and password. If realm isn't set, it will be deduced automatically from the first authentication challenge as for the hash algorithm. Sometimes, a userid is required by the proxy and then domain can be useful to discriminate different credentials. You can also use this object if you need to use a client certificate. Once created and filled, a AuthInfo must be added to the Core in order to become known and used automatically when needed. Use Core::addAuthInfo() for that purpose. The Core object can take the initiative to request authentication information when needed to the application through the authentication_requested() callback of it's CoreListener. The application can respond to this information request later using Core::addAuthInfo(). This will unblock all pending authentication transactions and retry them with authentication headers.
LINPHONECXX_PUBLIC void linphone::AuthInfo::addAvailableAlgorithm | ( | const std::string & | algorithm | ) |
Add an unique algorithm in the the available algorithms list : Algorithms that already exist will not be added.
algorithm | The algorithm to add. |
LINPHONECXX_PUBLIC std::shared_ptr<linphone::AuthInfo> linphone::AuthInfo::clone | ( | ) | const |
Instantiates a new auth info with values from source.
LINPHONECXX_PUBLIC std::string linphone::AuthInfo::getAlgorithm | ( | ) | const |
Gets the algorithm.
LINPHONECXX_PUBLIC std::list<std::string> linphone::AuthInfo::getAvailableAlgorithms | ( | ) | const |
Gets all available algorithms.
LINPHONECXX_PUBLIC std::string linphone::AuthInfo::getDomain | ( | ) | const |
Gets the domain.
LINPHONECXX_PUBLIC std::string linphone::AuthInfo::getHa1 | ( | ) | const |
Gets the ha1.
LINPHONECXX_PUBLIC std::string linphone::AuthInfo::getPassword | ( | ) | const |
Gets the password.
LINPHONECXX_PUBLIC std::string linphone::AuthInfo::getRealm | ( | ) | const |
Gets the realm.
LINPHONECXX_PUBLIC std::string linphone::AuthInfo::getTlsCert | ( | ) | const |
Gets the TLS certificate.
LINPHONECXX_PUBLIC std::string linphone::AuthInfo::getTlsCertPath | ( | ) | const |
Gets the TLS certificate path.
LINPHONECXX_PUBLIC std::string linphone::AuthInfo::getTlsKey | ( | ) | const |
Gets the TLS key.
LINPHONECXX_PUBLIC std::string linphone::AuthInfo::getTlsKeyPath | ( | ) | const |
Gets the TLS key path.
LINPHONECXX_PUBLIC std::string linphone::AuthInfo::getUserid | ( | ) | const |
Gets the user id.
LINPHONECXX_PUBLIC std::string linphone::AuthInfo::getUsername | ( | ) | const |
Gets the username.
LINPHONECXX_PUBLIC bool linphone::AuthInfo::isEqualButAlgorithms | ( | const std::shared_ptr< const linphone::AuthInfo > & | authInfo2 | ) | const |
Check if Authinfos are the same without taking account algorithms.
authInfo2 | The second AuthInfo object. |
LINPHONECXX_PUBLIC void linphone::AuthInfo::setAlgorithm | ( | const std::string & | algorithm | ) |
Sets the algorithm to use.
algorithm | The algorithm. |
LINPHONECXX_PUBLIC void linphone::AuthInfo::setAvailableAlgorithms | ( | const std::list< std::string > & | algorithms | ) |
Sets the available algorithms list without testing unicity.
algorithms | The available algorithms list. |
LINPHONECXX_PUBLIC void linphone::AuthInfo::setDomain | ( | const std::string & | domain | ) |
Sets the domain for which this authentication is valid.
domain | The domain. This should not be necessary because realm is supposed to be unique and sufficient. However, many SIP servers don't set realm correctly, then domain has to be used to distinguish between several SIP account bearing the same username. |
LINPHONECXX_PUBLIC void linphone::AuthInfo::setHa1 | ( | const std::string & | ha1 | ) |
Sets the ha1.
ha1 | The ha1. |
LINPHONECXX_PUBLIC void linphone::AuthInfo::setPassword | ( | const std::string & | password | ) |
Sets the password.
password | The password. |
LINPHONECXX_PUBLIC void linphone::AuthInfo::setRealm | ( | const std::string & | realm | ) |
Sets the realm.
realm | The realm. |
LINPHONECXX_PUBLIC void linphone::AuthInfo::setTlsCert | ( | const std::string & | tlsCert | ) |
Sets the TLS certificate.
tlsCert | The TLS certificate. |
LINPHONECXX_PUBLIC void linphone::AuthInfo::setTlsCertPath | ( | const std::string & | tlsCertPath | ) |
Sets the TLS certificate path.
tlsCertPath | The TLS certificate path. |
LINPHONECXX_PUBLIC void linphone::AuthInfo::setTlsKey | ( | const std::string & | tlsKey | ) |
Sets the TLS key.
tlsKey | The TLS key. |
LINPHONECXX_PUBLIC void linphone::AuthInfo::setTlsKeyPath | ( | const std::string & | tlsKeyPath | ) |
Sets the TLS key path.
tlsKeyPath | The TLS key path. |
LINPHONECXX_PUBLIC void linphone::AuthInfo::setUserid | ( | const std::string & | userId | ) |
Sets the user ID.
userId | The userid. |
LINPHONECXX_PUBLIC void linphone::AuthInfo::setUsername | ( | const std::string & | username | ) |
Sets the username.
username | The username. |