Open-Transactions  0.93.0-ge03d287
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
opentxs::OTPasswordData Class Reference

#include <OTPasswordData.hpp>

Public Member Functions

EXPORT bool isForNormalNym () const
 
EXPORT bool isForCachedKey () const
 
EXPORT const char * GetDisplayString () const
 
EXPORT bool isUsingOldSystem () const
 
EXPORT void setUsingOldSystem (bool bUsing=true)
 
OTPasswordGetMasterPW () const
 
std::shared_ptr< OTCachedKeyGetCachedKey () const
 
EXPORT OTPasswordData (const char *szDisplay, OTPassword *pMasterPW=nullptr, std::shared_ptr< OTCachedKey > pCachedKey=std::shared_ptr< OTCachedKey >())
 
EXPORT OTPasswordData (const std::string &str_Display, OTPassword *pMasterPW=nullptr, std::shared_ptr< OTCachedKey > pCachedKey=std::shared_ptr< OTCachedKey >())
 
EXPORT OTPasswordData (const OTString &strDisplay, OTPassword *pMasterPW=nullptr, std::shared_ptr< OTCachedKey > pCachedKey=std::shared_ptr< OTCachedKey >())
 
EXPORT ~OTPasswordData ()
 

Detailed Description

Definition at line 355 of file OTPasswordData.hpp.

Constructor & Destructor Documentation

opentxs::OTPasswordData::OTPasswordData ( const char *  szDisplay,
OTPassword pMasterPW = nullptr,
std::shared_ptr< OTCachedKey pCachedKey = std::shared_ptr<OTCachedKey>() 
)

Definition at line 229 of file OTPasswordData.cpp.

231  : m_pMasterPW(pMasterPW)
232  , m_strDisplay(nullptr == szDisplay ? "(Sorry, no user data provided.)"
233  : szDisplay)
234  , m_bUsingOldSystem(false)
235  , m_pCachedKey(pCachedKey)
236 {
237  // They can both be nullptr, or they can both be not nullptr.
238  // But you can't have one nullptr, and the other not.
239  OT_ASSERT(((nullptr == pMasterPW) && (!pCachedKey)) ||
240  ((nullptr != pMasterPW) && (pCachedKey)));
241 }
#define OT_ASSERT(x)
Definition: Assert.hpp:150
opentxs::OTPasswordData::OTPasswordData ( const std::string &  str_Display,
OTPassword pMasterPW = nullptr,
std::shared_ptr< OTCachedKey pCachedKey = std::shared_ptr<OTCachedKey>() 
)

Definition at line 243 of file OTPasswordData.cpp.

246  : m_pMasterPW(pMasterPW)
247  , m_strDisplay(str_Display)
248  , m_bUsingOldSystem(false)
249  , m_pCachedKey(pCachedKey)
250 {
251  // They can both be nullptr, or they can both be not nullptr.
252  // But you can't have one nullptr, and the other not.
253  OT_ASSERT(((nullptr == pMasterPW) && (!pCachedKey)) ||
254  ((nullptr != pMasterPW) && (pCachedKey)));
255 }
#define OT_ASSERT(x)
Definition: Assert.hpp:150
opentxs::OTPasswordData::OTPasswordData ( const OTString strDisplay,
OTPassword pMasterPW = nullptr,
std::shared_ptr< OTCachedKey pCachedKey = std::shared_ptr<OTCachedKey>() 
)

Definition at line 257 of file OTPasswordData.cpp.

260  : m_pMasterPW(pMasterPW)
261  , m_strDisplay(strDisplay.Get())
262  , m_bUsingOldSystem(false)
263  , m_pCachedKey(pCachedKey)
264 {
265  // They can both be nullptr, or they can both be not nullptr.
266  // But you can't have one nullptr, and the other not.
267  OT_ASSERT(((nullptr == pMasterPW) && (!pCachedKey)) ||
268  ((nullptr != pMasterPW) && (pCachedKey)));
269 }
#define OT_ASSERT(x)
Definition: Assert.hpp:150
opentxs::OTPasswordData::~OTPasswordData ( )

Definition at line 271 of file OTPasswordData.cpp.

272 {
273  m_pMasterPW = nullptr; // not owned
274  // m_pCachedKey = nullptr; // not owned
275 }

Member Function Documentation

std::shared_ptr<OTCachedKey> opentxs::OTPasswordData::GetCachedKey ( ) const
inline

Definition at line 377 of file OTPasswordData.hpp.

378  {
379  return m_pCachedKey;
380  }
const char * opentxs::OTPasswordData::GetDisplayString ( ) const

Definition at line 224 of file OTPasswordData.cpp.

225 {
226  return m_strDisplay.c_str();
227 }
OTPassword* opentxs::OTPasswordData::GetMasterPW ( ) const
inline

Definition at line 373 of file OTPasswordData.hpp.

374  {
375  return m_pMasterPW;
376  }
bool opentxs::OTPasswordData::isForCachedKey ( ) const

Definition at line 219 of file OTPasswordData.cpp.

220 {
221  return (nullptr != m_pMasterPW);
222 }
bool opentxs::OTPasswordData::isForNormalNym ( ) const

Definition at line 214 of file OTPasswordData.cpp.

215 {
216  return (nullptr == m_pMasterPW);
217 }
bool opentxs::OTPasswordData::isUsingOldSystem ( ) const

Definition at line 204 of file OTPasswordData.cpp.

205 {
206  return m_bUsingOldSystem;
207 }
void opentxs::OTPasswordData::setUsingOldSystem ( bool  bUsing = true)

Definition at line 209 of file OTPasswordData.cpp.

210 {
211  m_bUsingOldSystem = bUsing;
212 }

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