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