297 void update(
const char *data,
int len = -1);
637 const QString &
provider = QString());
663 const QString &
provider = QString());
758 bool ok()
const override;
989 unsigned int keyLength,
990 unsigned int iterationCount);
1007 unsigned int keyLength,
1009 unsigned int *iterationCount);
1058 explicit PBKDF1(
const QString &algorithm = QStringLiteral(
"sha1"),
const QString &
provider = QString())
1083 explicit PBKDF2(
const QString &algorithm = QStringLiteral(
"sha1"),
const QString &
provider = QString())
1109 explicit HKDF(
const QString &algorithm = QStringLiteral(
"sha256"),
const QString &
provider = QString());
1145 unsigned int keyLength);
QString type() const
The name of the algorithm type.
Provider * provider() const
The name of the provider.
Algorithm(const Algorithm &from)
Standard copy constructor.
Container for authentication tag.
Definition qca_core.h:1347
General superclass for buffered computation algorithms.
Definition qca_core.h:1052
bool validKeyLength(int n) const
Test if a key length is valid for the cipher algorithm.
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.
Direction direction() const
Return the cipher direction.
Cipher & operator=(const Cipher &from)
Assignment operator.
static QStringList supportedTypes(const QString &provider=QString())
Returns a list of all of the cipher types available.
Padding padding() const
Return the cipher padding type.
Mode
Mode settings for cipher algorithms.
Definition qca_basic.h:592
@ ECB
operate in Electronic Code Book mode
Definition qca_basic.h:595
@ OFB
operate in Output FeedBack Mode
Definition qca_basic.h:596
@ CCM
operate in Counter with CBC-MAC
Definition qca_basic.h:599
@ CFB
operate in Cipher FeedBack mode
Definition qca_basic.h:594
@ GCM
operate in Galois Counter Mode
Definition qca_basic.h:598
@ CTR
operate in CounTer Mode
Definition qca_basic.h:597
@ CBC
operate in Cipher Block Chaining mode
Definition qca_basic.h:593
void setup(Direction dir, const SymmetricKey &key, const InitializationVector &iv=InitializationVector())
Reset / reconfigure the Cipher.
QString type() const
Return the cipher type.
static QString withAlgorithms(const QString &cipherType, Mode modeType, Padding paddingType)
Construct a Cipher type string.
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.
AuthTag tag() const
return the authentication tag for the cipher object
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...
void setup(Direction dir, const SymmetricKey &key, const InitializationVector &iv, const AuthTag &tag)
Reset / reconfigure the Cipher.
bool ok() const override
Test if an update() or final() call succeeded.
void clear() override
reset the cipher object, to allow re-use
Cipher(const Cipher &from)
Standard copy constructor.
Mode mode() const
Return the cipher mode.
KeyLength keyLength() const
Return acceptable key lengths.
Padding
Padding variations for cipher algorithms.
Definition qca_basic.h:609
@ NoPadding
Do not use padding.
Definition qca_basic.h:611
@ DefaultPadding
Default for cipher-mode.
Definition qca_basic.h:610
@ PKCS7
Pad using the scheme in PKCS#7.
Definition qca_basic.h:612
int blockSize() const
return the block size for the cipher object
General superclass for filtering transformation algorithms.
Definition qca_core.h:1108
HKDF & operator=(const HKDF &from)
Assignment operator.
HKDF(const QString &algorithm=QStringLiteral("sha256"), const QString &provider=QString())
Standard constructor.
HKDF(const HKDF &from)
Standard copy constructor.
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.
static QStringList supportedTypes(const QString &provider=QString())
Returns a list of all of the hash types available.
void update(QIODevice *file)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void update(const MemoryRegion &a) override
Update a hash, adding more of the message contents to the digest.
MemoryRegion hash(const MemoryRegion &array)
Hash a byte array, returning it as another byte array
QString type() const
Return the hash type.
void clear() override
Reset a hash, dumping all previous parts of the message.
void update(const QByteArray &a)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Hash & operator=(const Hash &from)
Assignment operator.
Hash(const Hash &from)
Copy constructor.
QString hashToString(const MemoryRegion &array)
Hash a byte array, returning it as a printable string
Hash(const QString &type, const QString &provider=QString())
Constructor.
void update(const char *data, int len=-1)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Container for initialisation vectors and nonces.
Definition qca_core.h:1310
KeyDerivationFunction(const KeyDerivationFunction &from)
Standard copy constructor.
static QString withAlgorithm(const QString &kdfType, const QString &algType)
Construct the name of the algorithm.
KeyDerivationFunction & operator=(const KeyDerivationFunction &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.
SymmetricKey makeKey(const SecureArray &secret, const InitializationVector &salt, unsigned int keyLength, unsigned int iterationCount)
Generate the key from a specified secret and salt value.
KeyDerivationFunction(const QString &type, const QString &provider)
Special constructor for subclass initialisation.
Simple container for acceptable key lengths.
Definition qca_core.h:701
Array of bytes that may be optionally secured.
Definition qca_tools.h:91
bool validKeyLength(int n) const
Test if a key length is valid for the MAC algorithm.
MessageAuthenticationCode(const QString &type, const SymmetricKey &key, const QString &provider=QString())
Standard constructor.
static QStringList supportedTypes(const QString &provider=QString())
Returns a list of all of the message authentication code types available.
void setup(const SymmetricKey &key)
Initialise the MAC algorithm.
MessageAuthenticationCode & operator=(const MessageAuthenticationCode &from)
Assignment operator.
QString type() const
Return the MAC type.
void update(const MemoryRegion &array) override
Update the MAC, adding more of the message contents to the digest.
MessageAuthenticationCode(const MessageAuthenticationCode &from)
Standard copy constructor.
KeyLength keyLength() const
Return acceptable key lengths.
void clear() override
Reset a MessageAuthenticationCode, dumping all previous parts of the message.
PBKDF1(const QString &algorithm=QStringLiteral("sha1"), const QString &provider=QString())
Standard constructor.
Definition qca_basic.h:1058
PBKDF2(const QString &algorithm=QStringLiteral("sha1"), const QString &provider=QString())
Standard constructor.
Definition qca_basic.h:1083
uchar nextByte()
Provide a random byte.
Random & operator=(const Random &from)
Assignment operator.
Random(const Random &from)
Copy constructor.
static SecureArray randomArray(int size)
Provide a specified number of random bytes.
static int randomInt()
Provide a random integer.
Random(const QString &provider=QString())
Standard Constructor.
static uchar randomChar()
Provide a random character (byte).
SecureArray nextBytes(int size)
Provide a specified number of random bytes.
Secure array of bytes.
Definition qca_tools.h:317
Container for keys for symmetric encryption algorithms.
Definition qca_core.h:1264
QCA - the Qt Cryptographic Architecture.
Definition qca_basic.h:41
Direction
Direction settings for symmetric algorithms.
Definition qca_core.h:141
@ Encode
Operate in the "forward" direction; for example, encrypting.
Definition qca_core.h:142
Header file for core QCA infrastructure.