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

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

#include <enterapipwdialog.h>

Inheritance diagram for EnterApiPwDialog:
Collaboration diagram for EnterApiPwDialog:

Public Member Functions

 EnterApiPwDialog (const std::string &cipher, const std::string &nonce, const std::string &tag, QWidget *parent=nullptr)
 Initializes the dialog with data needed for decryption.
 
 ~EnterApiPwDialog ()
 Deletes the UI.
 
std::string getApiKey () const
 Returns the decrypted API key, if encryption was successful. Else: Returns an empty string.
 
bool wasSuccessful () const
 Indicates whether decryption was successful.
 

Private Slots

void on_buttonBox_accepted ()
 Tries to decrypt the API key with the entered password. On success: Closes the dialog. Else: Indicates failure to the user.
 
void on_buttonBox_rejected ()
 Closes the dialog.
 

Private Attributes

Ui::EnterApiPwDialog * 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.
 
std::string api_key_ = ""
 The decrypted API key, if decryption was successful.
 
bool success_ = false
 True if decryption was successful, else false.
 
bool dialog_completed_ = false
 Indicates whether the dialog has been completed.
 

Detailed Description

Dialog for entering the password used to encrypt the NexusMods API key.

Constructor & Destructor Documentation

◆ EnterApiPwDialog()

EnterApiPwDialog::EnterApiPwDialog ( 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

◆ getApiKey()

std::string EnterApiPwDialog::getApiKey ( ) const

Returns the decrypted API key, if encryption was successful. Else: Returns an empty string.

Returns
The API key.

◆ wasSuccessful()

bool EnterApiPwDialog::wasSuccessful ( ) const

Indicates whether decryption was successful.

Returns
True on success, else false.

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