00001 /* Password interface. 00002 * 00003 * Password interface (c) 2006 PegSoft 00004 * Contact us at pegsoft@pegsoft.net 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program (see the file COPYING); if not, write to the 00018 * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00019 */ 00020 00024 #ifndef PASSWORD_PASSWORD_H 00025 #define PASSWORD_PASSWORD_H 00026 00027 /*************************************************************************/ 00028 00029 #include <modules/interface.h> 00030 #include <modules/module.h> 00031 00032 /*************************************************************************/ 00033 00035 00036 namespace password 00037 { 00038 00039 /*************************************************************************/ 00040 00042 00052 class Encrypter : public modules::Interface 00053 { 00054 public: 00056 static modules::PSIID const IID = 0x43f29461; 00057 00059 virtual ~Encrypter() { } 00060 00062 00067 virtual modules::Module *module() = 0; 00068 00070 00074 virtual size_t length() const = 0; 00075 00077 00087 virtual bool encrypt(char const *pass, char *buf, 00088 size_t bufsize) = 0; 00089 00091 00100 virtual bool encrypt(char *buf, size_t size) = 0; 00101 00103 00108 virtual bool check(char const *plain, char const *pass) = 0; 00109 }; 00110 00111 /*************************************************************************/ 00112 00113 } /* namespace password */ 00114 00115 /*************************************************************************/ 00116 00117 #endif /* PASSWORD_PASSWORD_H */