merged AI doc, some new pages
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
/*! \file piethutilbase.h
|
||||
* \ingroup IO-Utils
|
||||
* \~\brief
|
||||
* \~english Base class for ethernet utils
|
||||
* \~russian Базовый класс для утилит ethernet
|
||||
*/
|
||||
//! \~\file piethutilbase.h
|
||||
//! \~\ingroup IO-Utils
|
||||
//! \~\brief
|
||||
//! \~english Base helper for optional crypt layer in IO-Utils transports
|
||||
//! \~russian Базовый помощник для необязательного слоя шифрования в транспортах IO-Utils
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
Base class for ethernet utils
|
||||
@@ -29,45 +28,67 @@
|
||||
#include "pibytearray.h"
|
||||
#include "pip_io_utils_export.h"
|
||||
|
||||
//! \~\ingroup IO-Utils
|
||||
//! \~\brief
|
||||
//! \~english Base helper that adds optional packet encryption to transport utilities.
|
||||
//! \~russian Базовый помощник, добавляющий необязательное шифрование пакетов в транспортные утилиты.
|
||||
class PIP_IO_UTILS_EXPORT PIEthUtilBase {
|
||||
public:
|
||||
//! \~english Constructs helper with crypt layer disabled.
|
||||
//! \~russian Создает помощник с выключенным слоем шифрования.
|
||||
PIEthUtilBase();
|
||||
|
||||
//! \~english Destroys the crypt helper.
|
||||
//! \~russian Уничтожает помощник шифрования.
|
||||
~PIEthUtilBase();
|
||||
|
||||
//! Set crypt layer enabled
|
||||
//! \~english Enables or disables the crypt layer.
|
||||
//! \~russian Включает или выключает слой шифрования.
|
||||
void setCryptEnabled(bool on);
|
||||
|
||||
//! Enable crypt layer
|
||||
//! \~english Enables the crypt layer.
|
||||
//! \~russian Включает слой шифрования.
|
||||
void cryptEnable();
|
||||
|
||||
//! Disable crypt layer
|
||||
//! \~english Disables the crypt layer.
|
||||
//! \~russian Выключает слой шифрования.
|
||||
void cryptDisable();
|
||||
|
||||
//! Returns if crypt layer enabled
|
||||
//! \~english Returns whether the crypt layer is enabled.
|
||||
//! \~russian Возвращает, включен ли слой шифрования.
|
||||
bool isCryptEnabled() const;
|
||||
|
||||
|
||||
//! Set crypt layer key to \"k\"
|
||||
//! \~english Sets crypt key "k" and enables the crypt layer.
|
||||
//! \~russian Устанавливает ключ шифрования "k" и включает слой шифрования.
|
||||
void setCryptKey(const PIByteArray & k);
|
||||
|
||||
//! Generate crypt layer key by \a PICrypt::hash and
|
||||
//! set crypt layer enabled
|
||||
//! \~english Generates crypt key from passphrase "k" and enables the crypt layer.
|
||||
//! \~russian Генерирует ключ шифрования из парольной фразы "k" и включает слой шифрования.
|
||||
void createCryptKey(const PIString & k);
|
||||
|
||||
//! Returns crypt layer key
|
||||
//! \~english Returns current crypt key.
|
||||
//! \~russian Возвращает текущий ключ шифрования.
|
||||
PIByteArray cryptKey() const;
|
||||
|
||||
//! \brief Returns addition size for crypted data.
|
||||
//! \~english Returns extra size added by encryption.
|
||||
//! \~russian Возвращает дополнительный размер, добавляемый шифрованием.
|
||||
static size_t cryptSizeAddition();
|
||||
|
||||
protected:
|
||||
/*! \brief Returns encrypted data if layer enabled,
|
||||
* otherwise returns unchanged \"data\" */
|
||||
//! \~english Encrypts "data" when the crypt layer is enabled.
|
||||
//! \~russian Шифрует "data", если слой шифрования включен.
|
||||
PIByteArray cryptData(const PIByteArray & data);
|
||||
|
||||
/*! \brief Returns decrypted data if layer enabled,
|
||||
* otherwise returns unchanged \"data\". If decryption
|
||||
* was unsuccessfull returns empty %PIByteArray. */
|
||||
//! \~english Decrypts "data" when the crypt layer is enabled.
|
||||
//! \~russian Дешифрует "data", если слой шифрования включен.
|
||||
//! \~\details
|
||||
//! \~english
|
||||
//! Returns decrypted data if layer enabled, otherwise returns unchanged "data". If decryption was unsuccessful returns empty
|
||||
//! %PIByteArray
|
||||
//! \~russian
|
||||
//! Возвращает расшифрованные данные, если слой включен, иначе возвращает неизмененные "data". Если расшифровка неуспешна, возвращает
|
||||
//! пустой %PIByteArray
|
||||
PIByteArray decryptData(const PIByteArray & data);
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user