password::Encrypter Class Reference

Password interface. More...

#include <password.h>

Inheritance diagram for password::Encrypter:

modules::Interface List of all members.

Public Member Functions

virtual ~Encrypter ()
 Destructor.
virtual modules::Modulemodule ()=0
 Returns the name of the module the implementation belongs to.
virtual size_t length () const=0
 Returns the length of encrypted passwords.
virtual bool encrypt (char const *pass, char *buf, size_t bufsize)=0
 Encrypts a password to a buffer.
virtual bool encrypt (char *buf, size_t size)=0
 Encrypts a password in-place.
virtual bool check (char const *plain, char const *pass)=0
 Checks a password.

Static Public Attributes

static modules::PSIID const IID = 0x43f29461
 Interface ID.

Detailed Description

This interface class can be used as a base class by modules providing password encryption.

You must override the check(), encrypt() (both versions), length() and module() functions in derived classes.

Modules must provide objects of this interface class through the Module::interface() function.


Member Function Documentation

virtual modules::Module* password::Encrypter::module (  )  [pure virtual]

Returns the name of the module the implementation belongs to. This is used to easily retrieve the module that generated an encrypted password.

Returns:
The module name.

virtual size_t password::Encrypter::length (  )  const [pure virtual]

Returns the length of passwords encrypted with this encryption scheme.

Returns:
The length of encrypted passwords.

virtual bool password::Encrypter::encrypt ( char const *  pass,
char *  buf,
size_t  bufsize 
) [pure virtual]

Encrypts a password to a submitted buffer. The encryption scheme is up to the implementer.

Parameters:
[in] pass A NULL-terminated password.
[out] buf The buffer the encrypted password will be written to. It must be encoded in a human-readable way and be NULL terminated.
[in] bufsize The size of the output buffer, which should be at least length() + 1.
Returns:
true if successful, false otherwise.

virtual bool password::Encrypter::encrypt ( char *  buf,
size_t  size 
) [pure virtual]

Encrypts a password in-place. The encryption scheme is up to the implementer.

Parameters:
[in] buf On input, this contains the NULL-terminated password that needs to be encrypted. On output, it contains the encrypted password, NULL-terminated and human-readable.
[in] size The maximum length of the buffer, which should be at least length() + 1.
Returns:
true if successful, false otherwise.

virtual bool password::Encrypter::check ( char const *  plain,
char const *  pass 
) [pure virtual]

Checks a password against a plaintext representation.

Parameters:
[in] plain The plaintext password to check.
[in] pass The encrypted password.
Returns:
true if it matches, false otherwise.


The documentation for this class was generated from the following file:
Generated on Wed Aug 15 00:37:23 2007 for Epona API by  doxygen 1.5.2