Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cpdf_encryptor.cpp
Go to the documentation of this file.
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#include "core/fpdfapi/parser/cpdf_encryptor.h"
8
9#include <stdint.h>
10
11#include "core/fpdfapi/parser/cpdf_crypto_handler.h"
12#include "core/fxcrt/check.h"
13#include "core/fxcrt/data_vector.h"
14
16 : m_pHandler(pHandler), m_ObjNum(objnum) {
17 DCHECK(m_pHandler);
18}
19
21 pdfium::span<const uint8_t> src_data) const {
22 if (src_data.empty()) {
23 return DataVector<uint8_t>();
24 }
25 return m_pHandler->EncryptContent(m_ObjNum, 0, src_data);
26}
27
28CPDF_Encryptor::~CPDF_Encryptor() = default;
#define DCHECK
Definition check.h:33
CPDF_Encryptor(const CPDF_CryptoHandler *pHandler, int objnum)
DataVector< uint8_t > Encrypt(pdfium::span< const uint8_t > src_data) const