QGIS API Documentation 3.41.0-Master (25ec5511245)
Loading...
Searching...
No Matches
qgsauthcrypto.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsauthcrypto.h
3 ---------------------
4 begin : October 5, 2014
5 copyright : (C) 2014 by Boundless Spatial, Inc. USA
6 author : Larry Shaffer
7 email : lshaffer at boundlessgeo dot com
8 ***************************************************************************
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 ***************************************************************************/
16
17#ifndef QGSAUTHCRYPTO_H
18#define QGSAUTHCRYPTO_H
19
20#define SIP_NO_FILE
21
22#include <QFile>
23#include <QString>
24
25#include "qgis_core.h"
26
32class CORE_EXPORT QgsAuthCrypto
33{
34
35 public:
37 static bool isDisabled();
38
40 static const QString encrypt( const QString &pass, const QString &cipheriv, const QString &text );
41
43 static const QString decrypt( const QString &pass, const QString &cipheriv, const QString &text );
44
46 static void passwordKeyHash( const QString &pass,
47 QString *salt,
48 QString *hash,
49 QString *cipheriv = nullptr );
50
52 static bool verifyPasswordKeyHash( const QString &pass,
53 const QString &salt,
54 const QString &hash,
55 QString *hashderived = nullptr );
56
57 private:
58 static QString encryptdecrypt( const QString &passstr,
59 const QString &cipheriv,
60 const QString &textstr,
61 bool encrypt );
62};
63
64#endif // QGSAUTHCRYPTO_H
Functions for hashing/checking master password and encrypt/decrypting data with password.