QCA::KeyGenerator
#include <QtCrypto>
Signals | |
void | finished () |
Public Member Functions | |
KeyGenerator (QObject *parent=nullptr) | |
bool | blockingEnabled () const |
PrivateKey | createDH (const DLGroup &domain, const QString &provider=QString()) |
DLGroup | createDLGroup (QCA::DLGroupSet set, const QString &provider=QString()) |
PrivateKey | createDSA (const DLGroup &domain, const QString &provider=QString()) |
PrivateKey | createRSA (int bits, int exp=65537, const QString &provider=QString()) |
DLGroup | dlGroup () const |
bool | isBusy () const |
PrivateKey | key () const |
void | setBlockingEnabled (bool b) |
Public Member Functions inherited from QObject | |
QObject (QObject *parent) | |
QBindable< QString > | bindableObjectName () |
bool | blockSignals (bool block) |
const QObjectList & | children () const const |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) const const |
bool | disconnect (const QObject *receiver, const char *method) const const |
void | dumpObjectInfo () const const |
void | dumpObjectTree () const const |
QList< QByteArray > | dynamicPropertyNames () const const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (Qt::FindChildOptions options) const const |
bool | inherits (const char *className) const const |
void | installEventFilter (QObject *filterObj) |
bool | isQuickItemType () const const |
bool | isWidgetType () const const |
bool | isWindowType () const const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const const |
void | moveToThread (QThread *targetThread) |
QString | objectName () const const |
void | objectNameChanged (const QString &objectName) |
QObject * | parent () const const |
QVariant | property (const char *name) const const |
Q_CLASSINFO (Name, Value) | |
Q_EMIT Q_EMIT | |
Q_ENUM (...) | |
Q_ENUM_NS (...) | |
Q_ENUMS (...) | |
Q_FLAG (...) | |
Q_FLAG_NS (...) | |
Q_FLAGS (...) | |
Q_GADGET Q_GADGET | |
Q_GADGET_EXPORT (EXPORT_MACRO) | |
Q_INTERFACES (...) | |
Q_INVOKABLE Q_INVOKABLE | |
Q_MOC_INCLUDE Q_MOC_INCLUDE | |
Q_NAMESPACE Q_NAMESPACE | |
Q_NAMESPACE_EXPORT (EXPORT_MACRO) | |
Q_OBJECT Q_OBJECT | |
Q_PROPERTY (...) | |
Q_REVISION Q_REVISION | |
Q_SET_OBJECT_NAME (Object) | |
Q_SIGNAL Q_SIGNAL | |
Q_SIGNALS Q_SIGNALS | |
Q_SLOT Q_SLOT | |
Q_SLOTS Q_SLOTS | |
T | qobject_cast (const QObject *object) |
T | qobject_cast (QObject *object) |
QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT | |
void | removeEventFilter (QObject *obj) |
void | setObjectName (const QString &name) |
void | setObjectName (QAnyStringView name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | setProperty (const char *name, QVariant &&value) |
bool | signalsBlocked () const const |
int | startTimer (int interval, Qt::TimerType timerType) |
int | startTimer (std::chrono::milliseconds interval, Qt::TimerType timerType) |
QThread * | thread () const const |
Additional Inherited Members | |
Public Types inherited from QObject | |
typedef | QObjectList |
Properties inherited from QObject | |
objectName | |
Static Public Member Functions inherited from QObject | |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, Functor functor) |
bool | disconnect (const QMetaObject::Connection &connection) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
bool | disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
Protected Member Functions inherited from QObject | |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
bool | isSignalConnected (const QMetaMethod &signal) const const |
int | receivers (const char *signal) const const |
QObject * | sender () const const |
int | senderSignalIndex () const const |
virtual void | timerEvent (QTimerEvent *event) |
Detailed Description
Class for generating asymmetric key pairs.
This class is used for generating asymmetric keys (public/private key pairs).
- Examples
- rsatest.cpp.
Definition at line 1137 of file qca_publickey.h.
Constructor & Destructor Documentation
◆ KeyGenerator()
QCA::KeyGenerator::KeyGenerator | ( | QObject * | parent = nullptr | ) |
Create a new key generator.
- Parameters
-
parent the parent object, if applicable
Member Function Documentation
◆ blockingEnabled()
bool QCA::KeyGenerator::blockingEnabled | ( | ) | const |
Test whether the key generator is set to operate in blocking mode, or not.
- Returns
- true if the key generator is in blocking mode
- See also
- setBlockingEnabled
◆ createDH()
PrivateKey QCA::KeyGenerator::createDH | ( | const DLGroup & | domain, |
const QString & | provider = QString() ) |
Generate a Diffie-Hellman key.
This method creates both the public key and corresponding private key. You almost certainly want to extract the public key part out - see PKey::toPublicKey for an easy way.
- Parameters
-
domain the discrete logarithm group that this key should be generated from provider the name of the provider to use, if a particular provider is required
- Note
- For compatibility, you should use one of the IETF_ groupsets as the domain argument.
◆ createDLGroup()
DLGroup QCA::KeyGenerator::createDLGroup | ( | QCA::DLGroupSet | set, |
const QString & | provider = QString() ) |
Create a new discrete logarithm group.
- Parameters
-
set the set of discrete logarithm parameters to generate from provider the name of the provider to use, if a particular provider is required.
◆ createDSA()
PrivateKey QCA::KeyGenerator::createDSA | ( | const DLGroup & | domain, |
const QString & | provider = QString() ) |
Generate a DSA key.
This method creates both the public key and corresponding private key. You almost certainly want to extract the public key part out - see PKey::toPublicKey for an easy way.
- Parameters
-
domain the discrete logarithm group that this key should be generated from provider the name of the provider to use, if a particular provider is required
- Note
- Not every DLGroup makes sense for DSA. You should use one of DSA_512, DSA_768 and DSA_1024.
◆ createRSA()
PrivateKey QCA::KeyGenerator::createRSA | ( | int | bits, |
int | exp = 65537, | ||
const QString & | provider = QString() ) |
Generate an RSA key of the specified length.
This method creates both the public key and corresponding private key. You almost certainly want to extract the public key part out - see PKey::toPublicKey for an easy way.
Key length is a tricky judgment - using less than 2048 is probably being too liberal for long term use. Don't use less than 1024 without serious analysis.
- Parameters
-
bits the length of key that is required exp the exponent - typically 3, 17 or 65537 provider the name of the provider to use, if a particular provider is required
- Examples
- rsatest.cpp.
◆ dlGroup()
DLGroup QCA::KeyGenerator::dlGroup | ( | ) | const |
The current discrete logarithm group.
◆ finished
|
signal |
Emitted when the key generation is complete.
This is only used in non-blocking mode
◆ isBusy()
bool QCA::KeyGenerator::isBusy | ( | ) | const |
Test if the key generator is currently busy, or not.
- Returns
- true if the key generator is busy generating a key already
◆ key()
PrivateKey QCA::KeyGenerator::key | ( | ) | const |
Return the last generated key.
This is really only useful when you are working with non-blocking key generation
◆ setBlockingEnabled()
void QCA::KeyGenerator::setBlockingEnabled | ( | bool | b | ) |
Set whether the key generator is in blocking mode, nor not.
- Parameters
-
b if true, the key generator will be set to operate in blocking mode, otherwise it will operate in non-blocking mode
- See also
- blockingEnabled()
The documentation for this class was generated from the following file:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:15:57 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.