OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 |
| 7 #ifndef CORE_INCLUDE_FPDFAPI_IPDF_CRYPTO_HANDLER_H_ |
| 8 #define CORE_INCLUDE_FPDFAPI_IPDF_CRYPTO_HANDLER_H_ |
| 9 |
| 10 #include "core/include/fxcrt/fx_string.h" |
| 11 #include "core/include/fxcrt/fx_system.h" |
| 12 |
| 13 class CPDF_Dictionary; |
| 14 class IPDF_SecurityHandler; |
| 15 |
| 16 class IPDF_CryptoHandler { |
| 17 public: |
| 18 virtual ~IPDF_CryptoHandler() {} |
| 19 |
| 20 virtual FX_BOOL Init(CPDF_Dictionary* pEncryptDict, |
| 21 IPDF_SecurityHandler* pSecurityHandler) = 0; |
| 22 |
| 23 virtual FX_DWORD DecryptGetSize(FX_DWORD src_size) = 0; |
| 24 virtual void* DecryptStart(FX_DWORD objnum, FX_DWORD gennum) = 0; |
| 25 virtual FX_BOOL DecryptStream(void* context, |
| 26 const uint8_t* src_buf, |
| 27 FX_DWORD src_size, |
| 28 CFX_BinaryBuf& dest_buf) = 0; |
| 29 |
| 30 virtual FX_BOOL DecryptFinish(void* context, CFX_BinaryBuf& dest_buf) = 0; |
| 31 virtual FX_DWORD EncryptGetSize(FX_DWORD objnum, |
| 32 FX_DWORD version, |
| 33 const uint8_t* src_buf, |
| 34 FX_DWORD src_size) = 0; |
| 35 |
| 36 virtual FX_BOOL EncryptContent(FX_DWORD objnum, |
| 37 FX_DWORD version, |
| 38 const uint8_t* src_buf, |
| 39 FX_DWORD src_size, |
| 40 uint8_t* dest_buf, |
| 41 FX_DWORD& dest_size) = 0; |
| 42 |
| 43 void Decrypt(FX_DWORD objnum, FX_DWORD version, CFX_ByteString& str); |
| 44 }; |
| 45 |
| 46 #endif // CORE_INCLUDE_FPDFAPI_IPDF_CRYPTO_HANDLER_H_ |
OLD | NEW |