2015-09-21 06:17:48 -06:00
|
|
|
class QgsAuthCrypto
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgsauthcrypto.h>
|
|
|
|
%End
|
|
|
|
|
|
|
|
public:
|
2016-02-14 03:50:23 +01:00
|
|
|
/** Whether QCA has the qca-ossl plugin, which a base run-time requirement */
|
2015-09-21 06:17:48 -06:00
|
|
|
static bool isDisabled();
|
|
|
|
|
2016-02-14 03:50:23 +01:00
|
|
|
/** Encrypt data using master password */
|
2015-10-07 11:55:34 +11:00
|
|
|
static const QString encrypt( const QString& pass, const QString& cipheriv, const QString& text );
|
2015-09-21 06:17:48 -06:00
|
|
|
|
2016-02-14 03:50:23 +01:00
|
|
|
/** Decrypt data using master password */
|
2015-10-07 11:55:34 +11:00
|
|
|
static const QString decrypt( const QString& pass, const QString& cipheriv, const QString& text );
|
2015-09-21 06:17:48 -06:00
|
|
|
|
2016-02-14 03:50:23 +01:00
|
|
|
/** Generate SHA256 hash for master password, with iterations and salt */
|
2015-09-21 06:17:48 -06:00
|
|
|
static void passwordKeyHash( const QString &pass,
|
|
|
|
QString *salt,
|
|
|
|
QString *hash,
|
|
|
|
QString *cipheriv = 0 );
|
|
|
|
|
2016-02-14 03:50:23 +01:00
|
|
|
/** Verify existing master password hash to a re-generated one */
|
2015-09-21 06:17:48 -06:00
|
|
|
static bool verifyPasswordKeyHash( const QString& pass,
|
|
|
|
const QString& salt,
|
|
|
|
const QString& hash,
|
|
|
|
QString *hashderived = 0 );
|
|
|
|
};
|