Limo
A simple mod manager
Loading...
Searching...
No Matches
changeapipwdialog.h
1
5#pragma once
6
7#include <QDialog>
8
9
10namespace Ui
11{
12class ChangeApiPwDialog;
13}
14
18class ChangeApiPwDialog : public QDialog
19{
20 Q_OBJECT
21
22public:
30 explicit ChangeApiPwDialog(bool uses_default_pw,
31 const std::string& cipher = "",
32 const std::string& nonce = "",
33 const std::string& tag = "",
34 QWidget* parent = nullptr);
37
38private:
40 Ui::ChangeApiPwDialog* ui;
42 std::string cipher_;
44 std::string nonce_;
46 std::string tag_;
48 bool dialog_completed_ = false;
51
52private slots:
57 void onPasswordValidityChanged(bool is_valid);
65
66signals:
74 void keyEncryptionUpdated(std::string cipher,
75 std::string nonce,
76 std::string tag,
77 bool default_pw);
78};
void keyEncryptionUpdated(std::string cipher, std::string nonce, std::string tag, bool default_pw)
Signals that the NexusMods api key is to be encrypted with a new password.
ChangeApiPwDialog(bool uses_default_pw, const std::string &cipher="", const std::string &nonce="", const std::string &tag="", QWidget *parent=nullptr)
Initializes the dialog with data needed for decryption.
Definition changeapipwdialog.cpp:9
std::string nonce_
AES-GCM nonce used during encryption.
Definition changeapipwdialog.h:44
void on_button_box_accepted()
Tries to decrypt the API key with the old password. If that fails: Shows an error....
Definition changeapipwdialog.cpp:42
void onPasswordValidityChanged(bool is_valid)
Disables/ enables the OK button, depending on if the entered passwords match.
Definition changeapipwdialog.cpp:37
std::string tag_
AES-GCM authorization tag generated during encryption.
Definition changeapipwdialog.h:46
Ui::ChangeApiPwDialog * ui
Contains auto-generated UI elements.
Definition changeapipwdialog.h:40
std::string cipher_
Cypher text of the API key.
Definition changeapipwdialog.h:42
void on_button_box_rejected()
Closes the dialog.
Definition changeapipwdialog.cpp:89
~ChangeApiPwDialog()
Deletes the UI.
Definition changeapipwdialog.cpp:32
bool dialog_completed_
Indicates whether the dialog has been completed.
Definition changeapipwdialog.h:48
bool uses_default_pw_
If true: Key is encrypted using cryptography::default_key.
Definition changeapipwdialog.h:50