PoDoFo 1.2.0
Loading...
Searching...
No Matches
PdfEncryptSession.h
1// SPDX-FileCopyrightText: 2022 Francesco Pretto <ceztko@gmail.com>
2// SPDX-License-Identifier: LGPL-2.0-or-later OR MPL-2.0
3
4#ifndef PDF_ENCRYPT_SESSION
5#define PDF_ENCRYPT_SESSION
6
7#include "PdfEncrypt.h"
8
9namespace PoDoFo {
10
12class PODOFO_API PdfEncryptSession final
13{
14 friend class PdfMemDocument;
15 PODOFO_PRIVATE_FRIEND(class PdfParser);
16 PODOFO_PRIVATE_FRIEND(class PdfImmediateWriter);
17
18private:
20 PdfEncryptSession(const PdfEncrypt& encrypt, const PdfEncryptContext& context);
21 PdfEncryptSession(std::shared_ptr<PdfEncrypt>&& encrypt);
22 PdfEncryptSession(const PdfEncryptSession&) = default;
23
24public:
25 PdfEncrypt& GetEncrypt() { return *m_Encrypt; }
26 PdfEncryptContext& GetContext() { return m_Context; }
27
28 bool HasOwnerPermissions() { return m_Context.GetAuthResult() == PdfAuthResult::Owner; }
29
30private:
31 PdfEncryptSession& operator=(const PdfEncryptSession&) = delete;
32
33private:
34 std::shared_ptr<PdfEncrypt> m_Encrypt;
35 PdfEncryptContext m_Context;
36};
37
38}
39
40#endif // PDF_ENCRYPT_SESSION
A bundle of the encrypt object together a context.
Definition PdfEncryptSession.h:13
A class that is used to encrypt a PDF file and set document permissions on the PDF file.
Definition PdfEncrypt.h:111
PdfMemDocument is the core class for reading and manipulating PDF files and writing them back to disk...
Definition PdfMemDocument.h:35
Convenient type for char array storage and/or buffer with std::string compatibility.
Definition basetypes.h:30
All classes, functions, types and enums of PoDoFo are members of these namespace.
Definition basetypes.h:13