OpenAB  1.0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
OpenAB::SecureString Class Reference

SecureString class, used to store strings like passwords etc. Current implementation encodes string into two strings using simple XOR encoding. More...

#include <SecureString.hpp>

Public Member Functions

 SecureString ()
 Default constructor. More...
 
 SecureString (const char *str)
 Constructor. More...
 
 SecureString (const std::string &str)
 Constructor. More...
 
 SecureString (const SecureString &other)
 Copy constructor. More...
 
SecureStringoperator= (const SecureString &other)
 Assignment operator. More...
 
virtual ~SecureString ()
 Destructor, virtual by default. More...
 
char * str () const
 Returns managed string. When returned string is no longer needed, clearStr should be called. More...
 
void clearStr () const
 Clears internal state after calling str(). To be used when string returned by str() is no longer needed. More...
 
void clear ()
 Clears managed string. More...
 
bool operator== (const SecureString &other) const
 Comparison operator. More...
 

Detailed Description

SecureString class, used to store strings like passwords etc. Current implementation encodes string into two strings using simple XOR encoding.

Todo:
Currently this class in not secure at all, but in future may be extended to keep strings in memory in more secured way.

Constructor & Destructor Documentation

OpenAB::SecureString::SecureString ( )

Default constructor.

OpenAB::SecureString::SecureString ( const char *  str)

Constructor.

Parameters
[in]strstring to be managed by this object.
OpenAB::SecureString::SecureString ( const std::string &  str)

Constructor.

Parameters
[in]strstring to be managed by this object.
OpenAB::SecureString::SecureString ( const SecureString other)

Copy constructor.

OpenAB::SecureString::~SecureString ( )
virtual

Destructor, virtual by default.

Member Function Documentation

void OpenAB::SecureString::clear ( )

Clears managed string.

void OpenAB::SecureString::clearStr ( ) const

Clears internal state after calling str(). To be used when string returned by str() is no longer needed.

SecureString & OpenAB::SecureString::operator= ( const SecureString other)

Assignment operator.

bool OpenAB::SecureString::operator== ( const SecureString other) const

Comparison operator.

char * OpenAB::SecureString::str ( ) const

Returns managed string. When returned string is no longer needed, clearStr should be called.

Returns
managed string.

The documentation for this class was generated from the following files: