#include <QtCrypto>
Inheritance diagram for QCA::Cipher:
Public Types | |
enum | Mode { CBC, CFB, ECB, OFB } |
enum | Padding { DefaultPadding, NoPadding, PKCS7 } |
Public Member Functions | |
Cipher (const QString &type, Mode mode, Padding pad=DefaultPadding, Direction dir=Encode, const SymmetricKey &key=SymmetricKey(), const InitializationVector &iv=InitializationVector(), const QString &provider=QString()) | |
Cipher (const Cipher &from) | |
Cipher & | operator= (const Cipher &from) |
QString | type () const |
Mode | mode () const |
Padding | padding () const |
Direction | direction () const |
KeyLength | keyLength () const |
bool | validKeyLength (int n) const |
int | blockSize () const |
virtual void | clear () |
virtual MemoryRegion | update (const MemoryRegion &a) |
virtual MemoryRegion | final () |
virtual bool | ok () const |
void | setup (Direction dir, const SymmetricKey &key, const InitializationVector &iv=InitializationVector()) |
Static Public Member Functions | |
static QString | withAlgorithms (const QString &cipherType, Mode modeType, Padding paddingType) |
Cipher is the class for the various algorithms that perform low level encryption and decryption within QCA.
AES128, AES192 and AES256 are recommended for new applications.
Standard names for ciphers are:
aes-cmac.cpp, and ciphertest.cpp.
|
Mode settings for cipher algorithms.
|
|
Padding variations for cipher algorithms.
|
|
Standard constructor.
|
|
Standard copy constructor.
|
|
Assignment operator.
|
|
Return the cipher type.
Reimplemented from QCA::Algorithm. |
|
Return the cipher mode.
|
|
Return the cipher padding type.
|
|
Return the cipher direction.
|
|
Return acceptable key lengths.
|
|
Test if a key length is valid for the cipher algorithm.
|
|
return the block size for the cipher object
|
|
reset the cipher object, to allow re-use
Implements QCA::Filter. |
|
pass in a byte array of data, which will be encrypted or decrypted (according to the Direction that was set in the constructor or in setup() ) and returned.
Implements QCA::Filter.
|
|
complete the block of data, padding as required, and returning the completed block
Implements QCA::Filter. |
|
Test if an update() or final() call succeeded.
Implements QCA::Filter.
|
|
Reset / reconfigure the Cipher. You can use this to re-use an existing Cipher, rather than creating a new object with a slightly different configuration.
|
|
Construct a Cipher type string.
|