QCA::KeyDerivationFunction

Search for usage in LXR

#include <QtCrypto>

Inheritance diagram for QCA::KeyDerivationFunction:

Public Member Functions

 KeyDerivationFunction (const KeyDerivationFunction &from)
 
SymmetricKey makeKey (const SecureArray &secret, const InitializationVector &salt, unsigned int keyLength, int msecInterval, unsigned int *iterationCount)
 
SymmetricKey makeKey (const SecureArray &secret, const InitializationVector &salt, unsigned int keyLength, unsigned int iterationCount)
 
KeyDerivationFunctionoperator= (const KeyDerivationFunction &from)
 
- Public Member Functions inherited from QCA::Algorithm
 Algorithm (const Algorithm &from)
 
void change (const QString &type, const QString &provider)
 
void change (Provider::Context *c)
 
Provider::Contextcontext ()
 
const Provider::Contextcontext () const
 
Algorithmoperator= (const Algorithm &from)
 
Providerprovider () const
 
Provider::ContexttakeContext ()
 
QString type () const
 

Static Public Member Functions

static QString withAlgorithm (const QString &kdfType, const QString &algType)
 

Protected Member Functions

 KeyDerivationFunction (const QString &type, const QString &provider)
 
- Protected Member Functions inherited from QCA::Algorithm
 Algorithm ()
 
 Algorithm (const QString &type, const QString &provider)
 

Detailed Description

General superclass for key derivation algorithms.

KeyDerivationFunction is a superclass for the various key derivation function algorithms within QCA. You should not need to use it directly unless you are adding another key derivation capability to QCA - you should be using a sub-class. PBKDF2 using SHA1 is recommended for new applications.

Definition at line 953 of file qca_basic.h.

Constructor & Destructor Documentation

◆ KeyDerivationFunction() [1/2]

QCA::KeyDerivationFunction::KeyDerivationFunction ( const KeyDerivationFunction & from)

Standard copy constructor.

Parameters
fromthe KeyDerivationFunction to copy from

◆ KeyDerivationFunction() [2/2]

QCA::KeyDerivationFunction::KeyDerivationFunction ( const QString & type,
const QString & provider )
protected

Special constructor for subclass initialisation.

Parameters
typethe algorithm to create
providerthe name of the provider to create the key derivation function in.

Member Function Documentation

◆ makeKey() [1/2]

SymmetricKey QCA::KeyDerivationFunction::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.

Note
key length is ignored for some functions
Parameters
secretthe secret (password or passphrase)
saltthe salt to use
keyLengththe length of key to return
msecIntervalthe maximum time to compute the key, in milliseconds
iterationCounta pointer to store the number of iteration done for the specified time
Returns
the derived key

◆ makeKey() [2/2]

SymmetricKey QCA::KeyDerivationFunction::makeKey ( const SecureArray & secret,
const InitializationVector & salt,
unsigned int keyLength,
unsigned int iterationCount )

Generate the key from a specified secret and salt value.

Note
key length is ignored for some functions
Parameters
secretthe secret (password or passphrase)
saltthe salt to use
keyLengththe length of key to return
iterationCountthe number of iterations to perform
Returns
the derived key

◆ operator=()

KeyDerivationFunction & QCA::KeyDerivationFunction::operator= ( const KeyDerivationFunction & from)

Assignment operator.

Copies the state (including key) from one KeyDerivationFunction to another

Parameters
fromthe KeyDerivationFunction to assign from

◆ withAlgorithm()

static QString QCA::KeyDerivationFunction::withAlgorithm ( const QString & kdfType,
const QString & algType )
static

Construct the name of the algorithm.

You can use this to build a standard name string. You probably only need this method if you are creating a new subclass.

Parameters
kdfTypethe type of key derivation function
algTypethe name of the algorithm to use with the key derivation function
Returns
the name of the KDF/algorithm pair

The documentation for this class was generated from the following file:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:15:57 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.