Yosokumo::Credentials Class Reference

Specifies credentials (user id and key) for Yosokumo authentication. More...

#include <Credentials.h>

List of all members.

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.
Credentialsoperator= (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.

Detailed Description

Specifies credentials (user id and key) for Yosokumo authentication.

Definition at line 19 of file Credentials.h.


Member Enumeration Documentation

anonymous enum

The exact length of a key.

Enumerator:
KEY_LEN 

Definition at line 26 of file Credentials.h.


Constructor & Destructor Documentation

Credentials::Credentials (  ) 

Default constructor - initializes a newly created Credentials object with default values.

Definition at line 11 of file Credentials.cpp.

References key, and userId.

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.

Parameters:
userId the user to whom the key belongs.
key the key.
Exceptions:
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.

Parameters:
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.


Member Function Documentation

void Credentials::getKey ( std::vector< uint8_t > &  theKey  ) 

Return a copy of the user key.

Parameters:
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.

Returns:
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.

Parameters:
key the key to convert to a string.
Returns:
the string representation of key.

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.

Parameters:
rhs the righthand side of the inequality.
Returns:
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.

Parameters:
rhs the righthand side of the assignment.
Returns:
a reference to this Credentials.

Definition at line 35 of file Credentials.cpp.

References key, and userId.

Referenced by Credentials().

bool Credentials::operator== ( const Credentials rhs  )  const

Equality operator - compare two Credentials for equality.

Parameters:
rhs the righthand side of the equality.
Returns:
true if and only if this Credentials and the righthand side Credentials are identically equal.

Definition at line 49 of file Credentials.cpp.

References key, and userId.

std::string Credentials::toString (  ) 

Return a string representation of the Credentials.

Returns:
the string representation of the Credentials.

Definition at line 75 of file Credentials.cpp.

References getUserId(), key, and keyToString().

Referenced by Yosokumo::YosokumoRequest::makeRequest().


Member Data Documentation

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==().


The documentation for this class was generated from the following files:
Generated on Mon May 13 09:19:11 2013 for C++ Yosokumo API by  doxygen 1.6.3