Public Member Functions | Protected Member Functions

SignOn::EncryptedDevice Class Reference

#include <encrypteddevice.h>

List of all members.

Public Member Functions

 EncryptedDevice (QIODevice *actualDevice, const unsigned char *encryptionKey, unsigned int keySize, const unsigned char *ivOn, const unsigned char *ivOut)
virtual bool isSequential () const
virtual bool open (OpenMode mode)
virtual void close ()
virtual qint64 bytesAvailable () const
virtual qint64 bytesToWrite () const
void setTemporaryDataSource (QByteArray *tmp)
void clearTemporaryDataSource ()

Protected Member Functions

virtual qint64 readData (char *data, qint64 maxLen)
virtual qint64 writeData (const char *data, qint64 len)

Detailed Description

EncryptedDevice allows encrypting (and decrypting) all data that passes through a normal, unencrypted device. The encryption is done using AES in OFB mode. EncryptedDevice always works in sequential mode even if the underlying device supported random access.

Definition at line 40 of file encrypteddevice.h.


Constructor & Destructor Documentation

EncryptedDevice::EncryptedDevice ( QIODevice *  actualDevice,
const unsigned char *  encryptionKey,
unsigned int  keySize,
const unsigned char *  ivOn,
const unsigned char *  ivOut 
)

Constructor

Parameters:
actualDevice The device that acts as the real data source / sink
encryptionKey The encryption key
keySize Size of encryption key in bytes. Must be either 16, 24 or 32
ivIn Initialization vector for data read from the device. The size of the initialization vector must be the same as AES block size, i.e. 16 bytes
ivOut Initialization vector for data written to the device. The size of the initialization vector must be the same as AES block size, i.e. 16 bytes

Definition at line 34 of file encrypteddevice.cpp.


Member Function Documentation

void SignOn::EncryptedDevice::setTemporaryDataSource ( QByteArray *  tmp  )  [inline]

Temporarily switches all input to use the given QByteArray instead of the QIODevice given when this device was constructed

Definition at line 72 of file encrypteddevice.h.


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