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 55 of file partdec.h.


Constructor & Destructor Documentation

PartDec::PartDec (  ) 

Definition at line 30 of file partdec.cc.

References name, and YAPET::NAME_SIZE.

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

Definition at line 34 of file partdec.cc.

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

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

Definition at line 45 of file partdec.cc.

References setRecord().

PartDec::PartDec ( const PartDec pd  ) 

Definition at line 49 of file partdec.cc.

References name, and YAPET::NAME_SIZE.

PartDec::~PartDec (  ) 

Definition at line 53 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 113 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 94 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 104 of file partdec.h.

References name.

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

This is mainly used for sorting the entries...

Definition at line 85 of file partdec.cc.

References name.

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

Definition at line 70 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 58 of file partdec.cc.

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

Referenced by PartDec().


Member Data Documentation

This is the encrypted password record.

Definition at line 68 of file partdec.h.

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

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

The password record name in plain text.

Definition at line 62 of file partdec.h.

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


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

Generated on Sun Jul 20 13:01:44 2008 for YAPET by  doxygen 1.5.6