Qt Cryptographic Architecture
QCA::KeyLength Class Reference

#include <QtCrypto>

Public Member Functions

 KeyLength (int min, int max, int multiple)
int maximum () const
int minimum () const
int multiple () const

Detailed Description

Simple container for acceptable key lengths.

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 );
KeyLength(int min, int max, int multiple)
Construct a KeyLength object.
Definition qca_core.h:711

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 );
Examples
aes-cmac.cpp.

Constructor & Destructor Documentation

◆ KeyLength()

QCA::KeyLength::KeyLength ( int min,
int max,
int multiple )
inline

Construct a KeyLength object.

Parameters
minthe minimum length of the key, in bytes
maxthe maximum length of the key, in bytes
multiplethe number of bytes that the key must be a multiple of.

References multiple().

Member Function Documentation

◆ minimum()

int QCA::KeyLength::minimum ( ) const
inline

Obtain the minimum length for the key, in bytes.

◆ maximum()

int QCA::KeyLength::maximum ( ) const
inline

Obtain the maximum length for the key, in bytes.

◆ multiple()

int QCA::KeyLength::multiple ( ) const
inline

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.

Referenced by KeyLength().


The documentation for this class was generated from the following file: