Qt Cryptographic Architecture
|
#include <QtCrypto>
Public Member Functions | |
uchar | nextByte () |
SecureArray | nextBytes (int size) |
Random & | operator= (const Random &from) |
Random (const QString &provider=QString()) | |
Random (const Random &from) | |
![]() | |
Algorithm (const Algorithm &from) | |
void | change (Provider::Context *c) |
void | change (const QString &type, const QString &provider) |
Provider::Context * | context () |
const Provider::Context * | context () const |
Algorithm & | operator= (const Algorithm &from) |
Provider * | provider () const |
Provider::Context * | takeContext () |
QString | type () const |
Static Public Member Functions | |
static SecureArray | randomArray (int size) |
static uchar | randomChar () |
static int | randomInt () |
Additional Inherited Members | |
![]() | |
Algorithm () | |
Algorithm (const QString &type, const QString &provider) | |
Source of random numbers.
QCA provides a built in source of random numbers, which can be accessed through this class. You can also use an alternative random number source, by implementing another provider.
The normal use of this class is expected to be through the static members - randomChar(), randomInt() and randomArray().
QCA::Random::Random | ( | const QString & | provider = QString() | ) |
Standard Constructor.
provider | the name of the provider library for the random number generation |
QCA::Random::Random | ( | const Random & | from | ) |
Copy constructor.
from | the Random object to copy from |
Assignment operator.
from | the Random object to copy state from |
uchar QCA::Random::nextByte | ( | ) |
Provide a random byte.
This method isn't normally required - you should use the static randomChar() method instead.
SecureArray QCA::Random::nextBytes | ( | int | size | ) |
Provide a specified number of random bytes.
This method isn't normally required - you should use the static randomArray() method instead.
size | the number of bytes to provide |
|
static |
Provide a random character (byte)
This is the normal way of obtaining a single random char (ie. 8 bit byte), as shown below:
If you need a number of bytes, perhaps randomArray() may be of use.
|
static |
Provide a random integer.
This is the normal way of obtaining a single random integer, as shown below:
|
static |
Provide a specified number of random bytes.
size | the number of bytes to provide |