#include <password.h>
Public Member Functions | |
virtual | ~Encrypter () |
Destructor. | |
virtual modules::Module * | module ()=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. |
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.
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.
virtual size_t password::Encrypter::length | ( | ) | const [pure virtual] |
Returns the length of passwords encrypted with this encryption scheme.
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.
[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. |
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.
[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. |
virtual bool password::Encrypter::check | ( | char const * | plain, | |
char const * | pass | |||
) | [pure virtual] |