QCA::KeyGenerator Class Reference

Class for generating asymmetric key pairs. More...

#include <QtCrypto>

Inheritance diagram for QCA::KeyGenerator:

QObject Collaboration diagram for QCA::KeyGenerator:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 KeyGenerator (QObject *parent=0)
bool blockingEnabled () const
void setBlockingEnabled (bool b)
bool isBusy () const
PrivateKey createRSA (int bits, int exp=65537, const QString &provider=QString())
PrivateKey createDSA (const DLGroup &domain, const QString &provider=QString())
PrivateKey createDH (const DLGroup &domain, const QString &provider=QString())
PrivateKey key () const
DLGroup createDLGroup (QCA::DLGroupSet set, const QString &provider=QString())
DLGroup dlGroup () const

Public Attributes

Q_SIGNALS __pad0__: void finished()

Friends

class Private

Detailed Description

Class for generating asymmetric key pairs.

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

Examples:

rsatest.cpp.


Constructor & Destructor Documentation

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

Create a new key generator.

Parameters:
parent the parent object, if applicable


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

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

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

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

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.

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.

PrivateKey QCA::KeyGenerator::key  )  const
 

Return the last generated key.

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

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.

DLGroup QCA::KeyGenerator::dlGroup  )  const
 

The current discrete logarithm group.


The documentation for this class was generated from the following file:
Generated on Fri Jul 6 12:15:20 2007 for Qt Cryptographic Architecture by  doxygen 1.4.6