Specifies credentials (user id and key) for Yosokumo authentication. More...
#include <Credentials.h>
Public Types | |
enum | { KEY_LEN = 64 } |
The exact length of a key. More... | |
Public Member Functions | |
Credentials () | |
Default constructor - initializes a newly created Credentials object with default values. | |
Credentials (const std::string &userId, const std::vector< uint8_t > &key) throw (ServiceException) | |
Initializes a newly created Credentials object to the user id and key given as parameters. | |
Credentials (const Credentials &rhs) | |
Copy constructor - initializes a newly created Credentials object with a copy of another Credentials object. | |
virtual | ~Credentials () |
Destructor - destroy a Credentials object. | |
Credentials & | operator= (const Credentials &rhs) |
Assignment operator - assign one Credentials to another. | |
bool | operator== (const Credentials &rhs) const |
Equality operator - compare two Credentials for equality. | |
bool | operator!= (const Credentials &rhs) const |
Inequality operator - compare two Credentials for inequality. | |
std::string | getUserId () |
Return the user id. | |
void | getKey (std::vector< uint8_t > &theKey) |
Return a copy of the user key. | |
std::string | toString () |
Return a string representation of the Credentials . | |
Static Public Member Functions | |
static std::string | keyToString (const std::vector< uint8_t > &key) |
Return a string representation of a key. | |
Private Attributes | |
std::string | userId |
The user to whom the key belongs. | |
std::vector< uint8_t > | key |
The key belonging to the user. |
Specifies credentials (user id and key) for Yosokumo authentication.
Definition at line 19 of file Credentials.h.
anonymous enum |
Credentials::Credentials | ( | ) |
Default constructor - initializes a newly created Credentials
object with default values.
Definition at line 11 of file Credentials.cpp.
Credentials::Credentials | ( | const std::string & | userId, | |
const std::vector< uint8_t > & | key | |||
) | throw (ServiceException) |
Initializes a newly created Credentials
object to the user id and key given as parameters.
userId | the user to whom the key belongs. | |
key | the key. |
ServiceException | if the key length is not correct. |
Definition at line 17 of file Credentials.cpp.
Credentials::Credentials | ( | const Credentials & | rhs | ) |
Copy constructor - initializes a newly created Credentials
object with a copy of another Credentials
object.
rhs | the Credentials to make a copy of. |
Definition at line 27 of file Credentials.cpp.
References operator=().
Credentials::~Credentials | ( | ) | [virtual] |
Destructor - destroy a Credentials
object.
Definition at line 32 of file Credentials.cpp.
void Credentials::getKey | ( | std::vector< uint8_t > & | theKey | ) |
Return a copy of the user key.
theKey | a copy of the user key is placed in this vector. |
Definition at line 70 of file Credentials.cpp.
References key.
Referenced by Yosokumo::YosokumoRequest::makeDigest().
std::string Credentials::getUserId | ( | ) |
Return the user id.
Definition at line 65 of file Credentials.cpp.
References userId.
Referenced by Yosokumo::YosokumoRequest::makeRequest(), and toString().
std::string Credentials::keyToString | ( | const std::vector< uint8_t > & | key | ) | [static] |
Return a string representation of a key.
key | the key to convert to a string. |
Definition at line 88 of file Credentials.cpp.
References KEY_LEN.
Referenced by toString().
bool Credentials::operator!= | ( | const Credentials & | rhs | ) | const |
Inequality operator - compare two Credentials
for inequality.
rhs | the righthand side of the inequality. |
true
if and only if this
Credentials
and the righthand side Credentials
are not identically equal. Definition at line 59 of file Credentials.cpp.
Credentials & Credentials::operator= | ( | const Credentials & | rhs | ) |
Assignment operator - assign one Credentials
to another.
rhs | the righthand side of the assignment. |
this
Credentials. Definition at line 35 of file Credentials.cpp.
Referenced by Credentials().
bool Credentials::operator== | ( | const Credentials & | rhs | ) | const |
Equality operator - compare two Credentials
for equality.
rhs | the righthand side of the equality. |
true
if and only if this
Credentials
and the righthand side Credentials
are identically equal. Definition at line 49 of file Credentials.cpp.
std::string Credentials::toString | ( | ) |
Return a string representation of the Credentials
.
Credentials
. Definition at line 75 of file Credentials.cpp.
References getUserId(), key, and keyToString().
Referenced by Yosokumo::YosokumoRequest::makeRequest().
std::vector<uint8_t> Yosokumo::Credentials::key [private] |
The key belonging to the user.
It contains KEY_LEN bytes.
Definition at line 38 of file Credentials.h.
Referenced by Credentials(), getKey(), operator=(), operator==(), and toString().
std::string Yosokumo::Credentials::userId [private] |
The user to whom the key belongs.
Definition at line 33 of file Credentials.h.
Referenced by Credentials(), getUserId(), operator=(), and operator==().