Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

PinPlugin Class Reference

Multi-authentication plugin, implementing a PIN verification. More...

#include </home/clem/local/src/opie/noncore/securityplugins/pin/pin.h>

Inheritance diagram for PinPlugin:

Inheritance graph
[legend]
Collaboration diagram for PinPlugin:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 PinPlugin ()
 Standard c'tor.
virtual ~PinPlugin ()
 deletes m_pinW if we need to
int authenticate ()
 Prompt, fullscreen, for the user's PIN and compare it to the stored one.
Opie::Security::MultiauthConfigWidgetconfigWidget (QWidget *parent)
 returns a PinConfigWidget
QString pixmapNameConfig () const
 (optional) plugin configuration tab icon
QString pixmapNameWidget () const
 Plugin icon, to be displayed in the plugin list configuration widget.
QString pluginName () const
 Simply returns the plugin name (PIN plugin).

Private Slots

QString getPIN (const QString &prompt)
 Displays a PinDialog and returns the typed in PIN.
QString getCryptedPIN (const QString &prompt)
 Displays the PIN dialog and returns a hash of the typed in PIN.
void changePIN ()
 Displays the PIN dialog, asks 2 times for a new PIN, saves it if entered two times.
void clearPIN ()
 Removes the PIN hashed value in the config file.

Private Member Functions

QString encrypt (const QString &pin)
 generate a fairly random salt and return the PIN hashed by crypt()
bool verify (const QString &pin, const QString &hash)
 verify a PIN against its crypt() hash

Private Attributes

PinConfigWidgetm_pinW

Detailed Description

Multi-authentication plugin, implementing a PIN verification.

The plugin itself, implementing the main authenticate() function.

Definition at line 46 of file pin.h.


Constructor & Destructor Documentation

PinPlugin::PinPlugin  ) 
 

Standard c'tor.

Definition at line 321 of file pin.cpp.

PinPlugin::~PinPlugin  )  [virtual]
 

deletes m_pinW if we need to

Definition at line 325 of file pin.cpp.

References m_pinW.


Member Function Documentation

int PinPlugin::authenticate  )  [virtual]
 

Prompt, fullscreen, for the user's PIN and compare it to the stored one.

Returns:
the result code, as a MultiauthPluginObject::authResult object

Implements Opie::Security::MultiauthPluginObject.

Definition at line 293 of file pin.cpp.

References FALSE, QString::isEmpty(), isSkip, oendl, owarn, PinDlg::pinD, Config::readEntry(), PinDlg::reset(), Config::setGroup(), PinDialog::text, TRUE, and verify().

void PinPlugin::changePIN  )  [private, slot]
 

Displays the PIN dialog, asks 2 times for a new PIN, saves it if entered two times.

writes nothing if we enter nothing the first time

Definition at line 265 of file pin.cpp.

References encrypt(), getPIN(), QString::isNull(), odebug, oendl, Config::setGroup(), tr, and Config::writeEntry().

Referenced by configWidget().

void PinPlugin::clearPIN  )  [private, slot]
 

Removes the PIN hashed value in the config file.

Definition at line 282 of file pin.cpp.

References Config::removeEntry(), and Config::setGroup().

Referenced by configWidget().

MultiauthConfigWidget * PinPlugin::configWidget QWidget *  parent  )  [virtual]
 

returns a PinConfigWidget

Implements Opie::Security::MultiauthPluginObject.

Definition at line 344 of file pin.cpp.

References changePIN(), PinConfigWidget::changePIN, clearPIN(), PinConfigWidget::clearPIN, and m_pinW.

QString PinPlugin::encrypt const QString pin  )  [private]
 

generate a fairly random salt and return the PIN hashed by crypt()

Definition at line 201 of file pin.cpp.

References crypt(), QString::fromLatin1(), i, and QString::latin1().

Referenced by changePIN(), and getCryptedPIN().

QString PinPlugin::getCryptedPIN const QString prompt  )  [private, slot]
 

Displays the PIN dialog and returns a hash of the typed in PIN.

Returns:
the hashed ( =one-way encrypted) PIN typed in by the user
Parameters:
prompt the prompt to display in the PinDialog

Definition at line 256 of file pin.cpp.

References encrypt(), and getPIN().

QString PinPlugin::getPIN const QString prompt  )  [private, slot]
 

Displays a PinDialog and returns the typed in PIN.

The returned value is QString::null if the user cancels the operation, or the empty string if the user enters no password (but confirms the dialog).

Definition at line 233 of file pin.cpp.

References QString::isEmpty(), QString::null, PinDlg::pinD, PinDialog::setPrompt(), PinDialog::text, and TRUE.

Referenced by changePIN(), and getCryptedPIN().

QString PinPlugin::pixmapNameConfig  )  const [virtual]
 

(optional) plugin configuration tab icon

Returns:
path to the image file (without the extension) from $OPIEDIR/pics

Implements Opie::Security::MultiauthPluginObject.

Definition at line 339 of file pin.cpp.

QString PinPlugin::pixmapNameWidget  )  const [virtual]
 

Plugin icon, to be displayed in the plugin list configuration widget.

Returns:
path to the image file (without the extension) from $OPIEDIR/pics

Implements Opie::Security::MultiauthPluginObject.

Definition at line 335 of file pin.cpp.

QString PinPlugin::pluginName  )  const [virtual]
 

Simply returns the plugin name (PIN plugin).

Implements Opie::Security::MultiauthPluginObject.

Definition at line 331 of file pin.cpp.

bool PinPlugin::verify const QString pin,
const QString hash
[private]
 

verify a PIN against its crypt() hash

Returns:
true if the pin matches its hash

Definition at line 221 of file pin.cpp.

References QString::compare(), crypt(), QString::fromLatin1(), and QString::latin1().

Referenced by authenticate().


Member Data Documentation

PinConfigWidget* PinPlugin::m_pinW [private]
 

Definition at line 66 of file pin.h.

Referenced by configWidget(), and ~PinPlugin().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:44:45 2005 for OPIE by  doxygen 1.4.2