QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
auth
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
21
#include "qgis_core.h"
22
23
#include <QFile>
24
#include <QString>
25
26
#define SIP_NO_FILE
27
33
class
CORE_EXPORT
QgsAuthCrypto
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, QString *salt, QString *hash, QString *cipheriv =
nullptr
);
47
49
static
bool
verifyPasswordKeyHash
(
const
QString &pass,
const
QString &salt,
const
QString &hash, QString *hashderived =
nullptr
);
50
51
private
:
52
static
QString encryptdecrypt(
const
QString &passstr,
const
QString &cipheriv,
const
QString &textstr,
bool
encrypt
);
53
};
54
55
#endif
// QGSAUTHCRYPTO_H
QgsAuthCrypto
Functions for hashing/checking master password and encrypt/decrypting data with password.
Definition
qgsauthcrypto.h:34
QgsAuthCrypto::passwordKeyHash
static void passwordKeyHash(const QString &pass, QString *salt, QString *hash, QString *cipheriv=nullptr)
Generate SHA256 hash for master password, with iterations and salt.
Definition
qgsauthcrypto.cpp:68
QgsAuthCrypto::encrypt
static const QString encrypt(const QString &pass, const QString &cipheriv, const QString &text)
Encrypt data using master password.
Definition
qgsauthcrypto.cpp:45
QgsAuthCrypto::verifyPasswordKeyHash
static bool verifyPasswordKeyHash(const QString &pass, const QString &salt, const QString &hash, QString *hashderived=nullptr)
Verify existing master password hash to a re-generated one.
Definition
qgsauthcrypto.cpp:92
QgsAuthCrypto::decrypt
static const QString decrypt(const QString &pass, const QString &cipheriv, const QString &text)
Decrypt data using master password.
Definition
qgsauthcrypto.cpp:53
QgsAuthCrypto::isDisabled
static bool isDisabled()
Whether QCA has the qca-ossl plugin, which a base run-time requirement.
Definition
qgsauthcrypto.cpp:35
Generated on
for QGIS API Documentation by
1.17.0