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

Side by Side 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: 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 unified diff | Download patch
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698