1 // Copyright 2017 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_FPDFAPI_PARSER_CPDF_ENCRYPTOR_H_
8 #define CORE_FPDFAPI_PARSER_CPDF_ENCRYPTOR_H_
9 
10 #include <stdint.h>
11 
12 #include <vector>
13 
14 #include "core/fxcrt/unowned_ptr.h"
15 #include "third_party/base/span.h"
16 
17 class CPDF_CryptoHandler;
18 
19 class CPDF_Encryptor {
20  public:
21   CPDF_Encryptor(CPDF_CryptoHandler* pHandler, int objnum);
22   ~CPDF_Encryptor();
23 
24   std::vector<uint8_t> Encrypt(pdfium::span<const uint8_t> src_data) const;
25 
26  private:
27   UnownedPtr<CPDF_CryptoHandler> const m_pHandler;
28   const int m_ObjNum;
29 };
30 
31 #endif  // CORE_FPDFAPI_PARSER_CPDF_ENCRYPTOR_H_
32