📄 encoder.h
字号:
/*!
\file Encoder.h
\author Jackson
\date 13/1/2005
*/
#ifndef _LUCID_ENCRYPTION_ENCODER_H_
#define _LUCID_ENCRYPTION_ENCODER_H_
#ifdef _MSC_VER
#pragma once
#endif
#include "ShareLib.h"
#include "EncoderImplBase.h"
#include "EncodeAlgorithm.h"
namespace Lucid {
namespace Encryption {
//! \class TEncoder
/*!
\brief Encoder interface class
*/
class LUCID_ENCRYPTION_API TEncoder {
public:
//! Constructor
/*!
\param key key for encryption
\param key_length length of key
\param iv initial vector encryption
\param iv_length length of initial vector
\param algorithm encode algorithm used
*/
TEncoder(const unsigned char* key, unsigned int key_length, const unsigned char* iv = 0, unsigned int iv_length = 0, TEncodeAlgorithm algorithm = NO_ENCODE);
//! Copy Constructor
/*!
\param encoder encoder to be copied
*/
TEncoder(
const TEncoder& encoder);
//! Destructor
/*!
*/
~TEncoder();
/*!
\brief encode input byte array
\param input input byte array
\param output output byte array
\param input_len length of input array
\param output_len length of output array
*/
void Encode(const unsigned char* input, unsigned char* output, const int input_len, int& output_len) {
mEncoderImpl->Encode(input, output, input_len, output_len);
}
/*!
\brief decode input byte array
\param input input byte array
\param output output byte array
\param input_len length of input array
\param output_len length of output array
*/
void Decode(const unsigned char* input, unsigned char* output, const int input_len, int& output_len) {
mEncoderImpl->Decode(input, output, input_len, output_len);
}
/*!
\brief get the key for encryption/ decryption
*/
const unsigned char* GetKey() const {
return mEncoderImpl->GetKey();
}
/*!
\brief get the key length for encryption/ decryption
*/
unsigned int GetKeyLength() const {
return mEncoderImpl->GetKeyLength();
}
/*!
\brief get the initial vector for encryption/ decryption
*/
const unsigned char* GetIV() const {
return mEncoderImpl->GetIV();
}
/*!
\brief get the initial vector length for encryption/ decryption
*/
unsigned int GetIVLength() const {
return mEncoderImpl->GetIVLength();
}
/*!
\brief get the algorithm for encryption/ decryption
*/
TEncodeAlgorithm GetAlgorithm() const {
return mEncoderImpl->GetAlgorithm();
}
private:
TEncoderImplBase *mEncoderImpl;
};
}
}
#endif // _LUCID_ENCRYPTION_ENCODER_H_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -