5 #ifndef CUTELYSTPLUGIN_CREDENTIALPASSWORD_H 6 #define CUTELYSTPLUGIN_CREDENTIALPASSWORD_H 8 #include <QtCore/QCryptographicHash> 10 #include <Cutelyst/cutelyst_global.h> 11 #include <Cutelyst/Plugins/Authentication/authentication.h> 15 class CredentialPasswordPrivate;
44 void setPasswordField(
const QString &fieldName);
49 PasswordType passwordType()
const;
54 void setPasswordType(PasswordType type);
59 QString passwordPreSalt()
const;
64 void setPasswordPreSalt(
const QString &passwordPreSalt);
69 QString passwordPostSalt()
const;
74 void setPasswordPostSalt(
const QString &passwordPostSalt);
84 static bool validatePassword(
const QString &password,
const QString &correctHash);
96 static QByteArray createPassword(
const QByteArray &password, QCryptographicHash::Algorithm method,
int iterations,
int saltByteSize,
int hashByteSize);
123 static QByteArray pbkdf2(QCryptographicHash::Algorithm method,
125 int rounds,
int keyLength);
133 CredentialPasswordPrivate *d_ptr;
148 #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.
QByteArray toLatin1() const const
QString fromLatin1(const char *str, int size)
static bool validatePassword(const QByteArray &password, const QByteArray &correctHash)
Validates the given password against the correct hash.
QByteArray toUtf8() const const