18 #ifndef CUTELYSTPLUGIN_CREDENTIALPASSWORD_H 19 #define CUTELYSTPLUGIN_CREDENTIALPASSWORD_H 21 #include <QtCore/QCryptographicHash> 23 #include <Cutelyst/cutelyst_global.h> 24 #include <Cutelyst/Plugins/Authentication/authentication.h> 28 class CredentialPasswordPrivate;
52 QString passwordField()
const;
57 void setPasswordField(
const QString &fieldName);
62 PasswordType passwordType()
const;
67 void setPasswordType(PasswordType type);
72 QString passwordPreSalt()
const;
77 void setPasswordPreSalt(
const QString &passwordPreSalt);
82 QString passwordPostSalt()
const;
87 void setPasswordPostSalt(
const QString &passwordPostSalt);
92 static bool validatePassword(
const QByteArray &password,
const QByteArray &correctHash);
104 static QByteArray createPassword(
const QByteArray &password, QCryptographicHash::Algorithm method,
int iterations,
int saltByteSize,
int hashByteSize);
112 static QByteArray createPassword(
const QByteArray &password);
120 inline static QByteArray createPassword(
const QString &password);
131 static QByteArray pbkdf2(QCryptographicHash::Algorithm method,
132 const QByteArray &password,
const QByteArray &salt,
133 int rounds,
int keyLength);
138 static QByteArray hmac(QCryptographicHash::Algorithm method,
const QByteArray &key,
const QByteArray &message);
141 CredentialPasswordPrivate *d_ptr;
151 #endif // CUTELYSTPLUGIN_CREDENTIALPASSWORD_H
static QByteArray createPassword(const QByteArray &password, QCryptographicHash::Algorithm method, int iterations, int saltByteSize, int hashByteSize)
Creates a password hash string.
The Cutelyst namespace holds all public Cutelyst API.