QGIS API Documentation  2.18.3-Las Palmas (77b8c3d)
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 #include <QFile>
21 #include <QString>
22 
28 class CORE_EXPORT QgsAuthCrypto
29 {
30 
31  public:
33  static bool isDisabled();
34 
36  static const QString encrypt( const QString& pass, const QString& cipheriv, const QString& text );
37 
39  static const QString decrypt( const QString& pass, const QString& cipheriv, const QString& text );
40 
42  static void passwordKeyHash( const QString &pass,
43  QString *salt,
44  QString *hash,
45  QString *cipheriv = nullptr );
46 
48  static bool verifyPasswordKeyHash( const QString& pass,
49  const QString& salt,
50  const QString& hash,
51  QString *hashderived = nullptr );
52 
53  private:
54  static QString encryptdecrypt( const QString& passstr,
55  const QString& cipheriv,
56  const QString& textstr,
57  bool encrypt );
58 };
59 
60 #endif // QGSAUTHCRYPTO_H
Funtions for hashing/checking master password and encrypt/decrypting data with password.
Definition: qgsauthcrypto.h:28