Limo
A simple mod manager
Loading...
Searching...
No Matches
enterapipwdialog.h
Go to the documentation of this file.
1
5
6#pragma once
7
8#include <QDialog>
9
10
11namespace Ui
12{
13class EnterApiPwDialog;
14}
15
19class EnterApiPwDialog : public QDialog
20{
21 Q_OBJECT
22
23public:
31 explicit EnterApiPwDialog(const std::string& cipher,
32 const std::string& nonce,
33 const std::string& tag,
34 QWidget* parent = nullptr);
37
43 std::string getApiKey() const;
48 bool wasSuccessful() const;
49
50private slots:
58
59private:
61 Ui::EnterApiPwDialog* ui;
63 std::string cipher_;
65 std::string nonce_;
67 std::string tag_;
69 std::string api_key_ = "";
71 bool success_ = false;
73 bool dialog_completed_ = false;
74};
std::string getApiKey() const
Returns the decrypted API key, if encryption was successful. Else: Returns an empty string.
Definition enterapipwdialog.cpp:21
std::string cipher_
Cypher text of the API key.
Definition enterapipwdialog.h:63
bool success_
True if decryption was successful, else false.
Definition enterapipwdialog.h:71
EnterApiPwDialog(const std::string &cipher, const std::string &nonce, const std::string &tag, QWidget *parent=nullptr)
Initializes the dialog with data needed for decryption.
Definition enterapipwdialog.cpp:6
void on_buttonBox_rejected()
Closes the dialog.
Definition enterapipwdialog.cpp:52
void on_buttonBox_accepted()
Tries to decrypt the API key with the entered password. On success: Closes the dialog....
Definition enterapipwdialog.cpp:31
std::string api_key_
The decrypted API key, if decryption was successful.
Definition enterapipwdialog.h:69
Ui::EnterApiPwDialog * ui
Contains auto-generated UI elements.
Definition enterapipwdialog.h:61
std::string nonce_
AES-GCM nonce used during encryption.
Definition enterapipwdialog.h:65
bool dialog_completed_
Indicates whether the dialog has been completed.
Definition enterapipwdialog.h:73
std::string tag_
AES-GCM authorization tag generated during encryption.
Definition enterapipwdialog.h:67
~EnterApiPwDialog()
Deletes the UI.
Definition enterapipwdialog.cpp:16
bool wasSuccessful() const
Indicates whether decryption was successful.
Definition enterapipwdialog.cpp:26