Qt Cryptographic Architecture
|
#include <QtCrypto>
Signals | |
void | responseReady () |
Public Member Functions | |
bool | accepted () const |
void | ask (Event::PasswordStyle pstyle, const KeyStoreInfo &keyStoreInfo, const KeyStoreEntry &keyStoreEntry, void *ptr) |
void | ask (Event::PasswordStyle pstyle, const QString &fileName, void *ptr) |
void | cancel () |
SecureArray | password () const |
PasswordAsker (QObject *parent=nullptr) | |
void | waitForResponse () |
Friends | |
class | Private |
User password / passphrase / PIN handler.
This class is used to obtain a password from a user.
QCA::PasswordAsker::PasswordAsker | ( | QObject * | parent = nullptr | ) |
Construct a new asker.
parent | the parent object for this QObject |
void QCA::PasswordAsker::ask | ( | Event::PasswordStyle | pstyle, |
const KeyStoreInfo & | keyStoreInfo, | ||
const KeyStoreEntry & | keyStoreEntry, | ||
void * | ptr | ||
) |
queue a password / passphrase request associated with a key store
pstyle | the type of information required (e.g. PIN, passphrase or password) |
keyStoreInfo | info of the key store that the information is required for |
keyStoreEntry | the item in the key store that the information is required for (if applicable) |
ptr | opaque data |
void QCA::PasswordAsker::ask | ( | Event::PasswordStyle | pstyle, |
const QString & | fileName, | ||
void * | ptr | ||
) |
queue a password / passphrase request associated with a file
pstyle | the type of information required (e.g. PIN, passphrase or password) |
fileName | the name of the file that the information is required for |
ptr | opaque data |
void QCA::PasswordAsker::cancel | ( | ) |
Cancel the pending password / passphrase request.
void QCA::PasswordAsker::waitForResponse | ( | ) |
Block until the password / passphrase request is completed.
You can use the responseReady signal instead of blocking, if appropriate.
bool QCA::PasswordAsker::accepted | ( | ) | const |
Determine whether the password / passphrase was accepted or not.
In this context, returning true is indicative of the user clicking "Ok" or equivalent; and returning false indicates that either the user clicked "Cancel" or equivalent, or that the cancel() function was called, or that the request is still pending.
SecureArray QCA::PasswordAsker::password | ( | ) | const |
The password / passphrase / PIN provided by the user in response to the asker request.
This may be empty.
|
signal |
Emitted when the asker process has been completed.
You should check whether the user accepted() the response prior to relying on the password().