aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/qpdf/RC4.hh
diff options
context:
space:
mode:
Diffstat (limited to 'libqpdf/qpdf/RC4.hh')
-rw-r--r--libqpdf/qpdf/RC4.hh24
1 files changed, 24 insertions, 0 deletions
diff --git a/libqpdf/qpdf/RC4.hh b/libqpdf/qpdf/RC4.hh
new file mode 100644
index 00000000..22c43b36
--- /dev/null
+++ b/libqpdf/qpdf/RC4.hh
@@ -0,0 +1,24 @@
+#ifndef RC4_HH
+#define RC4_HH
+
+#include <qpdf/QPDFCryptoImpl.hh>
+#include <memory>
+#include <cstring>
+
+class RC4
+{
+ public:
+ // key_len of -1 means treat key_data as a null-terminated string
+ QPDF_DLL
+ RC4(unsigned char const* key_data, int key_len = -1);
+
+ // out_data = 0 means to encrypt/decrypt in place
+ QPDF_DLL
+ void process(unsigned char* in_data, size_t len,
+ unsigned char* out_data = 0);
+
+ private:
+ std::shared_ptr<QPDFCryptoImpl> crypto;
+};
+
+#endif // RC4_HH