• Skip to content
  • Skip to link menu
KDE 4.4 API Reference
  • KDE API Reference
  • KDE Support
  • Sitemap
  • Contact Us
 

qca

QCA::KeyGenerator

QCA::KeyGenerator Class Reference
[QCA user API]

Class for generating asymmetric key pairs. More...

#include <QtCrypto>

Inheritance diagram for QCA::KeyGenerator:
Inheritance graph
[legend]

List of all members.

Signals

void finished ()

Public Member Functions

 KeyGenerator (QObject *parent=0)
 ~KeyGenerator ()
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)

Detailed Description

Class for generating asymmetric key pairs.

This class is used for generating asymmetric keys (public/private key pairs).

Definition at line 1068 of file qca_publickey.h.


Constructor & Destructor Documentation

QCA::KeyGenerator::KeyGenerator ( QObject *  parent = 0  ) 

Create a new key generator.

Parameters:
parent the parent object, if applicable

Definition at line 1159 of file qca_publickey.cpp.

QCA::KeyGenerator::~KeyGenerator (  ) 

Definition at line 1166 of file qca_publickey.cpp.


Member Function Documentation

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

Definition at line 1171 of file qca_publickey.cpp.

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.

Definition at line 1238 of file qca_publickey.cpp.

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.

Definition at line 1269 of file qca_publickey.cpp.

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.

Definition at line 1212 of file qca_publickey.cpp.

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

Definition at line 1186 of file qca_publickey.cpp.

DLGroup QCA::KeyGenerator::dlGroup (  )  const

The current discrete logarithm group.

Definition at line 1298 of file qca_publickey.cpp.

void QCA::KeyGenerator::finished (  )  [signal]

Emitted when the key generation is complete.

This is only used in non-blocking mode

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

Definition at line 1181 of file qca_publickey.cpp.

PrivateKey QCA::KeyGenerator::key (  )  const

Return the last generated key.

This is really only useful when you are working with non-blocking key generation

Definition at line 1264 of file qca_publickey.cpp.

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()

Definition at line 1176 of file qca_publickey.cpp.


The documentation for this class was generated from the following files:
  • qca_publickey.h
  • qca_publickey.cpp

qca

Skip menu "qca"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

KDE Support

Skip menu "KDE Support"
  • akonadi
  • Decibel
  • grantlee
  • kdewin
  • phonon
  •     Backend
  • polkit-qt
  • qca
  • qimageblitz
  • soprano
  • strigi
  •     searchclient
  •     streamanalyzer
  •     streams
Generated for KDE Support by doxygen 1.5.9-20090814
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal