]>
vaikene.ee Git - evaf/blob - igenerator.h
3d1db68b0228640e33993707831a737f4dd21e8e
2 * @file PswGen/Generator/igenerator.h
3 * @brief Interface for password generator modules
6 * Copyright (c) 2011 Enar Vaikene
8 * This file is part of the eVaf C++ cross-platform application development framework.
10 * This file can be used under the terms of the GNU General Public License
11 * version 3.0 as published by the Free Software Foundation and appearing in
12 * the file LICENSE included in the packaging of this file. Please review the
13 * the following information to ensure the GNU General Public License version
14 * 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
16 * Alternatively, this file may be used in accordance with the Commercial License
17 * Agreement provided with the Software.
20 #ifndef __PSWGEN_GENERATOR_IGENERATOR_H
21 # define __PSWGEN_GENERATOR_IGENERATOR_H
30 * Password generator interface.
32 * This interface is used to generate strong passwords.
38 * Flags for the password generator.
41 ALPHANUMERIC
= 0x01 ///< Generated password contains only alphanumeric characters
45 * Generates a strong password
46 * @param name Name of the password
47 * @param masterPassword Master password
48 * @param length Length of the password (if zero, then uses the max length)
49 * @param flags Flags for the generator
50 * @return Generated password
52 * This function generates a strong password using the name and the master password string
53 * as inputs. Calling this function with the same input always returns the same generated
56 * The length of the password is specified with the length argument. However, the generated password
57 * is never longer than possible with the particular cryptographic method.
59 * Optional flags can be used to fine-tune the generator.
61 virtual QString
generatePassword(QString
const & name
, QString
const & masterPassword
, int length
, uint flags
= 0) const = 0;
64 * Returns the maximum length of generated passwords
65 * @return Maximum length
67 * This function returns the maximum length of generated passwords that is possible with the cryptographic method
68 * used by the module implementing this interface.
70 virtual int maxLength() const = 0;
74 } // namespace eVaf::PswGen
77 Q_DECLARE_INTERFACE(eVaf::PswGen::iGenerator
, "eVaf.PswGen.iGenerator/1.0")
79 #endif // igenerator.h