| OLD | NEW |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #ifndef CORE_FPDFAPI_FPDF_PARSER_CPDF_STANDARD_SECURITY_HANDLER_H_ | 7 #ifndef CORE_FPDFAPI_FPDF_PARSER_CPDF_STANDARD_SECURITY_HANDLER_H_ |
| 8 #define CORE_FPDFAPI_FPDF_PARSER_CPDF_STANDARD_SECURITY_HANDLER_H_ | 8 #define CORE_FPDFAPI_FPDF_PARSER_CPDF_STANDARD_SECURITY_HANDLER_H_ |
| 9 | 9 |
| 10 #include "core/fpdfapi/fpdf_parser/ipdf_security_handler.h" | 10 #include "core/fpdfapi/fpdf_parser/ipdf_security_handler.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 FX_BOOL OnInit(CPDF_Parser* pParser, CPDF_Dictionary* pEncryptDict) override; | 24 FX_BOOL OnInit(CPDF_Parser* pParser, CPDF_Dictionary* pEncryptDict) override; |
| 25 uint32_t GetPermissions() override; | 25 uint32_t GetPermissions() override; |
| 26 FX_BOOL GetCryptInfo(int& cipher, | 26 FX_BOOL GetCryptInfo(int& cipher, |
| 27 const uint8_t*& buffer, | 27 const uint8_t*& buffer, |
| 28 int& keylen) override; | 28 int& keylen) override; |
| 29 FX_BOOL IsMetadataEncrypted() override; | 29 FX_BOOL IsMetadataEncrypted() override; |
| 30 IPDF_CryptoHandler* CreateCryptoHandler() override; | 30 IPDF_CryptoHandler* CreateCryptoHandler() override; |
| 31 | 31 |
| 32 void OnCreate(CPDF_Dictionary* pEncryptDict, | 32 void OnCreate(CPDF_Dictionary* pEncryptDict, |
| 33 CPDF_Array* pIdArray, | 33 CPDF_Array* pIdArray, |
| 34 const uint8_t* user_pass, | 34 const CFX_ByteStringC& user_pass, |
| 35 uint32_t user_size, | |
| 36 const uint8_t* owner_pass, | |
| 37 uint32_t owner_size, | |
| 38 uint32_t type = PDF_ENCRYPT_CONTENT); | |
| 39 | |
| 40 void OnCreate(CPDF_Dictionary* pEncryptDict, | |
| 41 CPDF_Array* pIdArray, | |
| 42 const uint8_t* user_pass, | |
| 43 uint32_t user_size, | |
| 44 uint32_t type = PDF_ENCRYPT_CONTENT); | 35 uint32_t type = PDF_ENCRYPT_CONTENT); |
| 45 | 36 |
| 46 CFX_ByteString GetUserPassword(const uint8_t* owner_pass, | 37 CFX_ByteString GetUserPassword(const uint8_t* owner_pass, |
| 47 uint32_t pass_size, | 38 uint32_t pass_size, |
| 48 int32_t key_len); | 39 int32_t key_len); |
| 49 int CheckPassword(const uint8_t* password, | 40 int CheckPassword(const uint8_t* password, |
| 50 uint32_t pass_size, | 41 uint32_t pass_size, |
| 51 FX_BOOL bOwner, | 42 FX_BOOL bOwner, |
| 52 uint8_t* key, | 43 uint8_t* key, |
| 53 int key_len); | 44 int key_len); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 int m_Revision; | 87 int m_Revision; |
| 97 CPDF_Parser* m_pParser; | 88 CPDF_Parser* m_pParser; |
| 98 CPDF_Dictionary* m_pEncryptDict; | 89 CPDF_Dictionary* m_pEncryptDict; |
| 99 uint32_t m_Permissions; | 90 uint32_t m_Permissions; |
| 100 int m_Cipher; | 91 int m_Cipher; |
| 101 uint8_t m_EncryptKey[32]; | 92 uint8_t m_EncryptKey[32]; |
| 102 int m_KeyLen; | 93 int m_KeyLen; |
| 103 }; | 94 }; |
| 104 | 95 |
| 105 #endif // CORE_FPDFAPI_FPDF_PARSER_CPDF_STANDARD_SECURITY_HANDLER_H_ | 96 #endif // CORE_FPDFAPI_FPDF_PARSER_CPDF_STANDARD_SECURITY_HANDLER_H_ |
| OLD | NEW |