#include <QtCrypto>
Collaboration diagram for QCA::KeyLength:
Public Member Functions | |
KeyLength (int min, int max, int multiple) | |
int | minimum () const |
int | maximum () const |
int | multiple () const |
The KeyLength specifies the minimum and maximum byte sizes allowed for a key, as well as a "multiple" which the key size must evenly divide into.
As an example, if the key can be 4, 8 or 12 bytes, you can express this as
KeyLength keyLen( 4, 12, 4 );
If you want to express a KeyLength that takes any number of bytes (including zero), you may want to use
#include<limits> KeyLength( 0, std::numeric_limits<int>::max(), 1 );
|
Construct a KeyLength object.
|
|
Obtain the minimum length for the key, in bytes.
|
|
Obtain the maximum length for the key, in bytes.
|
|
Return the number of bytes that the key must be a multiple of. If this is one, then anything between minimum and maximum (inclusive) is acceptable. |