Limo
A simple mod manager
Loading...
Searching...
No Matches
ChangeApiPwDialog Class Reference

Dialog used for changing the current password used to encrypt the NexusMods API key. More...

#include <changeapipwdialog.h>

Inheritance diagram for ChangeApiPwDialog:
Collaboration diagram for ChangeApiPwDialog:

Signals

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.
 

Public Member Functions

 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.
 
 ~ChangeApiPwDialog ()
 Deletes the UI.
 

Private Slots

void onPasswordValidityChanged (bool is_valid)
 Disables/ enables the OK button, depending on if the entered passwords match.
 
void on_button_box_accepted ()
 Tries to decrypt the API key with the old password. If that fails: Shows an error. On success: Encrypts the key with the new password and closes the dialog.
 
void on_button_box_rejected ()
 Closes the dialog.
 

Private Attributes

Ui::ChangeApiPwDialog * ui
 Contains auto-generated UI elements.
 
std::string cipher_
 Cypher text of the API key.
 
std::string nonce_
 AES-GCM nonce used during encryption.
 
std::string tag_
 AES-GCM authorization tag generated during encryption.
 
bool dialog_completed_ = false
 Indicates whether the dialog has been completed.
 
bool uses_default_pw_
 If true: Key is encrypted using cryptography::default_key.
 

Detailed Description

Dialog used for changing the current password used to encrypt the NexusMods API key.

Constructor & Destructor Documentation

◆ ChangeApiPwDialog()

ChangeApiPwDialog::ChangeApiPwDialog ( bool uses_default_pw,
const std::string & cipher = "",
const std::string & nonce = "",
const std::string & tag = "",
QWidget * parent = nullptr )
explicit

Initializes the dialog with data needed for decryption.

Parameters
cipherCypher text of the API key.
nonceAES-GCM nonce used during encryption.
tagAES-GCM authorization tag generated during encryption.
parentParent for this widget, this is passed to the constructor of QDialog.

Member Function Documentation

◆ keyEncryptionUpdated

void ChangeApiPwDialog::keyEncryptionUpdated ( std::string cipher,
std::string nonce,
std::string tag,
bool default_pw )
signal

Signals that the NexusMods api key is to be encrypted with a new password.

Parameters
cipherCypher text of the API key.
nonceAES-GCM nonce used during encryption.
tagAES-GCM authorization tag generated during encryption.
uses_default_pwIf true: User set no password.

◆ onPasswordValidityChanged

void ChangeApiPwDialog::onPasswordValidityChanged ( bool is_valid)
privateslot

Disables/ enables the OK button, depending on if the entered passwords match.

Parameters
is_validTrue if both passwords match.

The documentation for this class was generated from the following files: