2018-08-12 18:07:22 +00:00
|
|
|
#ifndef PL_RC4_HH
|
|
|
|
#define PL_RC4_HH
|
2008-04-29 12:55:25 +00:00
|
|
|
|
|
|
|
#include <qpdf/Pipeline.hh>
|
|
|
|
|
|
|
|
#include <qpdf/RC4.hh>
|
|
|
|
|
2009-10-21 00:27:24 +00:00
|
|
|
class Pl_RC4: public Pipeline
|
2008-04-29 12:55:25 +00:00
|
|
|
{
|
|
|
|
public:
|
2019-06-21 03:35:23 +00:00
|
|
|
static size_t const def_bufsize = 65536;
|
2008-04-29 12:55:25 +00:00
|
|
|
|
|
|
|
// key_len of -1 means treat key_data as a null-terminated string
|
2009-10-21 01:45:13 +00:00
|
|
|
QPDF_DLL
|
2008-04-29 12:55:25 +00:00
|
|
|
Pl_RC4(char const* identifier, Pipeline* next,
|
|
|
|
unsigned char const* key_data, int key_len = -1,
|
2012-06-20 15:20:57 +00:00
|
|
|
size_t out_bufsize = def_bufsize);
|
2009-10-21 01:45:13 +00:00
|
|
|
QPDF_DLL
|
2008-04-29 12:55:25 +00:00
|
|
|
virtual ~Pl_RC4();
|
|
|
|
|
2009-10-21 01:45:13 +00:00
|
|
|
QPDF_DLL
|
2012-06-20 15:20:57 +00:00
|
|
|
virtual void write(unsigned char* data, size_t len);
|
2009-10-21 01:45:13 +00:00
|
|
|
QPDF_DLL
|
2008-04-29 12:55:25 +00:00
|
|
|
virtual void finish();
|
|
|
|
|
|
|
|
private:
|
2019-06-22 18:24:49 +00:00
|
|
|
PointerHolder<unsigned char> outbuf;
|
2012-06-20 15:20:57 +00:00
|
|
|
size_t out_bufsize;
|
2008-04-29 12:55:25 +00:00
|
|
|
RC4 rc4;
|
|
|
|
};
|
|
|
|
|
2018-08-12 18:07:22 +00:00
|
|
|
#endif // PL_RC4_HH
|