Qt Cryptographic Architecture
|
Go to the documentation of this file.
74 Random(
const QString &provider = QString());
219 explicit Hash(
const QString &type,
const QString &provider = QString());
297 void update(
const char *data,
int len = -1);
634 const QString &provider = QString());
656 const QString &provider = QString());
751 bool ok()
const override;
996 unsigned int keyLength,
998 unsigned int *iterationCount);
1047 explicit PBKDF1(
const QString &algorithm = QStringLiteral(
"sha1"),
const QString &provider = QString())
1070 explicit PBKDF2(
const QString &algorithm = QStringLiteral(
"sha1"),
const QString &provider = QString())
1094 explicit HKDF(
const QString &algorithm = QStringLiteral(
"sha256"),
const QString &provider = QString());
@ NoPadding
Do not use padding.
Definition: qca_basic.h:611
Definition: qca_basic.h:1039
@ CBC
operate in Cipher Block Chaining mode
Definition: qca_basic.h:593
Direction direction() const
Return the cipher direction.
Definition: qca_basic.h:66
void update(const char *data, int len=-1)
This is an overloaded member function, provided for convenience. It differs from the above function o...
@ ECB
operate in Electronic Code Book mode
Definition: qca_basic.h:595
Direction
Direction settings for symmetric algorithms.
Definition: qca_core.h:141
MemoryRegion update(const MemoryRegion &a) override
pass in a byte array of data, which will be encrypted or decrypted (according to the Direction that w...
Definition: qca_basic.h:582
Padding padding() const
Return the cipher padding type.
Random & operator=(const Random &from)
Assignment operator.
Hash(const Hash &from)
Copy constructor.
@ CTR
operate in CounTer Mode
Definition: qca_basic.h:597
uchar nextByte()
Provide a random byte.
Definition: qca_basic.h:1086
bool validKeyLength(int n) const
Test if a key length is valid for the MAC algorithm.
MemoryRegion hash(const MemoryRegion &array)
@ DefaultPadding
Default for cipher-mode.
Definition: qca_basic.h:610
Random(const QString &provider=QString())
Standard Constructor.
KeyLength keyLength() const
Return acceptable key lengths.
void update(const QByteArray &a)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Mode mode() const
Return the cipher mode.
QCA - the Qt Cryptographic Architecture.
Definition: qca_basic.h:41
@ Encode
Operate in the "forward" direction; for example, encrypting.
Definition: qca_core.h:142
Definition: qca_core.h:1152
HKDF(const QString &algorithm=QStringLiteral("sha256"), const QString &provider=QString())
Standard constructor.
KeyLength keyLength() const
Return acceptable key lengths.
bool ok() const override
Test if an update() or final() call succeeded.
QString hashToString(const MemoryRegion &array)
Hash a byte array, returning it as a printable string
MessageAuthenticationCode(const MessageAuthenticationCode &from)
Standard copy constructor.
MessageAuthenticationCode & operator=(const MessageAuthenticationCode &from)
Assignment operator.
SymmetricKey makeKey(const SecureArray &secret, const InitializationVector &salt, unsigned int keyLength, int msecInterval, unsigned int *iterationCount)
Generate the key from a specified secret and salt value.
Definition: qca_core.h:1252
void clear() override
Reset a MessageAuthenticationCode, dumping all previous parts of the message.
Cipher(const QString &type, Mode mode, Padding pad, Direction dir, const SymmetricKey &key, const InitializationVector &iv, const AuthTag &tag, const QString &provider=QString())
Standard constructor.
static QString withAlgorithm(const QString &kdfType, const QString &algType)
Construct the name of the algorithm.
void setup(const SymmetricKey &key)
Initialise the MAC algorithm.
static SecureArray randomArray(int size)
QString type() const
Return the hash type.
void update(const MemoryRegion &array) override
Update the MAC, adding more of the message contents to the digest.
KeyDerivationFunction(const KeyDerivationFunction &from)
Standard copy constructor.
Definition: qca_core.h:1298
Cipher(const Cipher &from)
Standard copy constructor.
Mode
Mode settings for cipher algorithms.
Definition: qca_basic.h:592
PBKDF2(const QString &algorithm=QStringLiteral("sha1"), const QString &provider=QString())
Standard constructor.
Definition: qca_basic.h:1070
void update(const MemoryRegion &a) override
Update a hash, adding more of the message contents to the digest.
Hash & operator=(const Hash &from)
Assignment operator.
void setup(Direction dir, const SymmetricKey &key, const InitializationVector &iv, const AuthTag &tag)
Reset / reconfigure the Cipher.
static QStringList supportedTypes(const QString &provider=QString())
Returns a list of all of the message authentication code types available.
AuthTag tag() const
return the authentication tag for the cipher object
int blockSize() const
return the block size for the cipher object
KeyDerivationFunction & operator=(const KeyDerivationFunction &from)
Assignment operator.
void update(QIODevice *file)
@ CFB
operate in Cipher FeedBack mode
Definition: qca_basic.h:594
bool validKeyLength(int n) const
Test if a key length is valid for the cipher algorithm.
HKDF & operator=(const HKDF &from)
Assignment operator.
SymmetricKey makeKey(const SecureArray &secret, const InitializationVector &salt, const InitializationVector &info, unsigned int keyLength)
Generate the key from a specified secret, salt value, and an additional info.
Definition: qca_basic.h:820
Definition: qca_tools.h:317
Padding
Padding variations for cipher algorithms.
Definition: qca_basic.h:609
KeyDerivationFunction(const QString &type, const QString &provider)
Special constructor for subclass initialisation.
Definition: qca_basic.h:946
static QStringList supportedTypes(const QString &provider=QString())
Returns a list of all of the hash types available.
Cipher & operator=(const Cipher &from)
Assignment operator.
SecureArray nextBytes(int size)
Provide a specified number of random bytes.
Definition: qca_core.h:1096
void clear() override
reset the cipher object, to allow re-use
static QStringList supportedTypes(const QString &provider=QString())
Returns a list of all of the cipher types available.
Definition: qca_tools.h:91
Definition: qca_basic.h:1062
void setup(Direction dir, const SymmetricKey &key, const InitializationVector &iv=InitializationVector())
Reset / reconfigure the Cipher.
@ OFB
operate in Output FeedBack Mode
Definition: qca_basic.h:596
static QString withAlgorithms(const QString &cipherType, Mode modeType, Padding paddingType)
Construct a Cipher type string.
SymmetricKey makeKey(const SecureArray &secret, const InitializationVector &salt, unsigned int keyLength, unsigned int iterationCount)
Generate the key from a specified secret and salt value.
Definition: qca_core.h:1335
void clear() override
Reset a hash, dumping all previous parts of the message.
HKDF(const HKDF &from)
Standard copy constructor.
Definition: qca_core.h:701
Definition: qca_core.h:1040
MessageAuthenticationCode(const QString &type, const SymmetricKey &key, const QString &provider=QString())
Standard constructor.
QString type() const
Return the MAC type.
PBKDF1(const QString &algorithm=QStringLiteral("sha1"), const QString &provider=QString())
Standard constructor.
Definition: qca_basic.h:1047
Definition: qca_basic.h:209
static uchar randomChar()
Hash(const QString &type, const QString &provider=QString())
Constructor.
Cipher(const QString &type, Mode mode, Padding pad=DefaultPadding, Direction dir=Encode, const SymmetricKey &key=SymmetricKey(), const InitializationVector &iv=InitializationVector(), const QString &provider=QString())
Standard constructor.
Random(const Random &from)
Copy constructor.
@ GCM
operate in Galois Counter Mode
Definition: qca_basic.h:598
QString type() const
Return the cipher type.