Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Unified Diff: core/include/fpdfapi/ipdf_crypto_handler.h

Issue 1782673002: Split off IPDF_CryptoHandler into its own .cpp/.h files (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Stray include. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: core/include/fpdfapi/ipdf_crypto_handler.h
diff --git a/core/include/fpdfapi/ipdf_crypto_handler.h b/core/include/fpdfapi/ipdf_crypto_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..61222e2aca193ae1ab69dfbb340826130e54df03
--- /dev/null
+++ b/core/include/fpdfapi/ipdf_crypto_handler.h
@@ -0,0 +1,45 @@
+// Copyright 2016 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef CORE_INCLUDE_FPDFAPI_IPDF_CRYPTO_HANDLER_H_
+#define CORE_INCLUDE_FPDFAPI_IPDF_CRYPTO_HANDLER_H_
+
+#include "core/include/fxcrt/fx_basic.h"
+
+class CPDF_Dictionary;
+class IPDF_SecurityHandler;
+
+class IPDF_CryptoHandler {
+ public:
+ virtual ~IPDF_CryptoHandler() {}
dsinclair 2016/03/10 01:35:55 nit: Move {} to a .cpp file to avoid chromium-styl
Tom Sepez 2016/03/10 01:42:09 Done.
+
+ virtual FX_BOOL Init(CPDF_Dictionary* pEncryptDict,
+ IPDF_SecurityHandler* pSecurityHandler) = 0;
+
+ virtual FX_DWORD DecryptGetSize(FX_DWORD src_size) = 0;
+ virtual void* DecryptStart(FX_DWORD objnum, FX_DWORD gennum) = 0;
+ virtual FX_BOOL DecryptStream(void* context,
+ const uint8_t* src_buf,
+ FX_DWORD src_size,
+ CFX_BinaryBuf& dest_buf) = 0;
+
+ virtual FX_BOOL DecryptFinish(void* context, CFX_BinaryBuf& dest_buf) = 0;
+ virtual FX_DWORD EncryptGetSize(FX_DWORD objnum,
+ FX_DWORD version,
+ const uint8_t* src_buf,
+ FX_DWORD src_size) = 0;
+
+ virtual FX_BOOL EncryptContent(FX_DWORD objnum,
+ FX_DWORD version,
+ const uint8_t* src_buf,
+ FX_DWORD src_size,
+ uint8_t* dest_buf,
+ FX_DWORD& dest_size) = 0;
+
+ void Decrypt(FX_DWORD objnum, FX_DWORD version, CFX_ByteString& str);
+};
+
+#endif // CORE_INCLUDE_FPDFAPI_IPDF_CRYPTO_HANDLER_H_

Powered by Google App Engine
This is Rietveld 408576698