YAPET::PartDec Class Reference

Holds a partially decrypted record. More...

#include <partdec.h>

List of all members.

Public Member Functions

const char * c_str () const
const BDBuffergetEncRecord () const
 Get the encrypted password record.
const uint8_t * getName () const
 Get the plain text name of the password record.
bool operator< (const PartDec &pd) const
const PartDecoperator= (const PartDec &pd)
 PartDec (const PartDec &pd)
 PartDec (Record< PasswordRecord > &pr, const Key &key) throw (YAPETException)
 PartDec (BDBuffer &bd, const Key &key) throw (YAPETException)
 PartDec ()
void setRecord (Record< PasswordRecord > &pr, const Key &key) throw (YAPETException)
 ~PartDec ()

Private Attributes

BDBuffer enc_data
 The encrypted password record.
uint8_t name [NAME_SIZE]
 The record name in plain text.


Detailed Description

Partially decrypted records have their name stored in plain text. The other fields of the password record remain encrypted. This class is used for convenience. It relieves the user of writing code for decrypting the record in order to get only the record name.

The File class uses this class when reading and returning the records stored in a file. It also expects a list of PartDec object when writing password records to the file.

The encrypted data is also attached to this class as a BDBuffer.

Definition at line 66 of file partdec.h.


Constructor & Destructor Documentation

PartDec::PartDec (  ) 

Definition at line 42 of file partdec.cc.

References name, and YAPET::NAME_SIZE.

PartDec::PartDec ( BDBuffer bd,
const Key key 
) throw (YAPETException)

Definition at line 46 of file partdec.cc.

References YAPET::Crypt::decrypt(), and YAPET::NAME_SIZE.

PartDec::PartDec ( Record< PasswordRecord > &  pr,
const Key key 
) throw (YAPETException)

Definition at line 57 of file partdec.cc.

PartDec::PartDec ( const PartDec pd  ) 

Definition at line 61 of file partdec.cc.

References name, and YAPET::NAME_SIZE.

PartDec::~PartDec (  ) 

Definition at line 65 of file partdec.cc.

References name, and YAPET::NAME_SIZE.


Member Function Documentation

const char* YAPET::PartDec::c_str (  )  const [inline]

This method has been added because YAPETUI::ListWidget expects the object assigned to the list being displayed to have a public method called c_str().

Get the plain text name of the password record.

Returns the pointer to the plain text name of the password record.

Returns:
pointer to the buffer holding the plain text name of the password record.

Definition at line 124 of file partdec.h.

References name.

const BDBuffer& YAPET::PartDec::getEncRecord (  )  const [inline]

Gets the encrypted password record associated with this object.

Returns:
reference to the BDBuffer holding the encrypted data.

Definition at line 105 of file partdec.h.

References enc_data.

Referenced by PasswordRecord::refresh().

const uint8_t* YAPET::PartDec::getName (  )  const [inline]

Returns the pointer to the plain text name of the password record.

Returns:
pointer to the buffer holding the plain text name of the password record.

Definition at line 115 of file partdec.h.

References name.

bool PartDec::operator< ( const PartDec pd  )  const

This is mainly used for sorting the entries...

Definition at line 97 of file partdec.cc.

References name.

const PartDec & PartDec::operator= ( const PartDec pd  ) 

Definition at line 82 of file partdec.cc.

References enc_data, name, and YAPET::NAME_SIZE.

void PartDec::setRecord ( Record< PasswordRecord > &  pr,
const Key key 
) throw (YAPETException)

Definition at line 70 of file partdec.cc.

References YAPET::Crypt::encrypt(), YAPET::PasswordRecord::name, and YAPET::NAME_SIZE.


Member Data Documentation

This is the encrypted password record.

Definition at line 79 of file partdec.h.

Referenced by getEncRecord(), and operator=().

uint8_t YAPET::PartDec::name[NAME_SIZE] [private]

The password record name in plain text.

Definition at line 73 of file partdec.h.

Referenced by c_str(), getName(), operator<(), operator=(), PartDec(), and ~PartDec().


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

Generated on Thu Jun 11 19:13:05 2009 for YAPET by  doxygen 1.5.8