PoDoFo 1.0.0-dev
Loading...
Searching...
No Matches
PdfEncrypt.h
1
7#ifndef PDF_ENCRYPT_H
8#define PDF_ENCRYPT_H
9
10#include "PdfString.h"
11#include "PdfReference.h"
12
13// Define an opaque type for the internal PoDoFo encryption context
14#ifndef PODOFO_CRYPT_CTX
15#define PODOFO_CRYPT_CTX void
16#endif // PODOFO_CRYPT_CTX
17
18namespace PoDoFo
19{
20
21class PdfDictionary;
22class InputStream;
23class PdfObject;
24class OutputStream;
25
26/* Class representing PDF encryption methods. (For internal use only)
27 * Based on code from Ulrich Telle: http://wxcode.sourceforge.net/components/wxpdfdoc/
28 * Original Copyright header:
29 * Name: pdfencrypt.h
30 * Purpose:
31 * Author: Ulrich Telle
32 * Modified by:
33 * Created: 2005-08-16
34 * Copyright: (c) Ulrich Telle
35 * Licence: wxWindows licence
36 */
37
41{
42 Unknown = 0,
43 L40 = 40,
44 L48 = 48,
45 L56 = 56,
46 L64 = 64,
47 L72 = 72,
48 L80 = 80,
49 L88 = 88,
50 L96 = 96,
51 L104 = 104,
52 L112 = 112,
53 L120 = 120,
54 L128 = 128,
55 L256 = 256
56};
57
60// ISO 32000-2:2020 7.6.4.2 "Standard encryption dictionary":
61// "The value of the P entry shall be interpreted as an unsigned
62// 32-bit quantity containing a set of flags."
64{
65 None = 0,
66 Print = 0x00000004,
67 Edit = 0x00000008,
68 Copy = 0x00000010,
69 EditNotes = 0x00000020,
70 FillAndSign = 0x00000100,
71 Accessible = 0x00000200,
72 DocAssembly = 0x00000400,
73 HighPrint = 0x00000800,
74 Default = Print
75 | Edit
76 | Copy
77 | EditNotes
81 | HighPrint
82};
83
88{
89 None = 0,
90 RC4V1 = 1,
91 RC4V2 = 2,
92 AESV2 = 4,
93 AESV3R5 = 8,
94 AESV3R6 = 16,
95};
96
98{
99 Unkwnon = 0,
100 Failed,
101 User,
102 Owner,
103};
104
105class PdfEncryptContext;
106
117class PODOFO_API PdfEncrypt
118{
119 friend class PdfEncryptMD5Base;
120 friend class PdfEncryptAESV3;
121 PODOFO_PRIVATE_FRIEND(class PdfEncryptSession);
122
123public:
124 virtual ~PdfEncrypt();
125
140 static std::unique_ptr<PdfEncrypt> Create(const std::string_view& userPassword,
141 const std::string_view& ownerPassword,
142 PdfPermissions protection = PdfPermissions::Default,
143 PdfEncryptionAlgorithm algorithm = PdfEncryptionAlgorithm::AESV3R6,
144 PdfKeyLength keyLength = PdfKeyLength::Unknown);
145
157 static std::unique_ptr<PdfEncrypt> CreateFromObject(const PdfObject& obj);
158
170 static PdfEncryptionAlgorithm GetEnabledEncryptionAlgorithms();
171
179 static bool IsEncryptionEnabled(PdfEncryptionAlgorithm algorithm);
180
185 void EnsureEncryptionInitialized(const PdfString& documentId, PdfEncryptContext& context);
186
195 void Authenticate(const std::string_view& password, const PdfString& documentId, PdfEncryptContext& context) const;
196
205
216 virtual std::unique_ptr<InputStream> CreateEncryptionInputStream(InputStream& inputStream, size_t inputLen,
217 PdfEncryptContext& context, const PdfReference& objref) const = 0;
218
229 virtual std::unique_ptr<OutputStream> CreateEncryptionOutputStream(OutputStream& outputStream,
230 PdfEncryptContext& context, const PdfReference& objref) const = 0;
231
235 inline PdfEncryptionAlgorithm GetEncryptAlgorithm() const { return m_Algorithm; }
236
246 bool IsOwnerPasswordSet() const;
247
255 bool IsPrintAllowed() const;
256
264 bool IsEditAllowed() const;
265
273 bool IsCopyAllowed() const;
274
282 bool IsEditNotesAllowed() const;
283
291 bool IsFillAndSignAllowed() const;
292
300 bool IsAccessibilityAllowed() const;
301
309 bool IsDocAssemblyAllowed() const;
310
318 bool IsHighPrintAllowed() const;
319
322 void EncryptTo(charbuff& out, const bufferview& view, PdfEncryptContext& context, const PdfReference& objref) const;
323
326 void DecryptTo(charbuff& out, const bufferview& view, PdfEncryptContext& context, const PdfReference& objref) const;
327
330 virtual size_t CalculateStreamLength(size_t length) const = 0;
331
334 virtual size_t CalculateStreamOffset() const = 0;
335
339 unsigned GetKeyLengthBytes() const;
340
343 bufferview GetUValue() const;
344
347 bufferview GetOValue() const;
348
349public:
352 PdfKeyLength GetKeyLength() const { return m_KeyLength; }
353
356 inline PdfPermissions GetPValue() const { return m_pValue; }
357
360 inline unsigned GetRevision() const { return m_rValue; }
361
362 inline bool IsMetadataEncrypted() const { return m_EncryptMetadata; }
363
364 inline bool IsParsed() const { return m_IsParsed; }
365
366protected:
367 inline const unsigned char* GetUValueRaw() const { return m_uValue; }
368
369 inline const unsigned char* GetOValueRaw() const { return m_oValue; }
370
371 inline const std::string& GetUserPassword() const { return m_userPass; }
372
373 inline const std::string& GetOwnerPassword() const { return m_ownerPass; }
374
375 int64_t GetPValueForSerialization() const;
376
377protected:
381 void InitFromValues(PdfEncryptionAlgorithm algorithm, PdfKeyLength keyLength, unsigned char revision,
382 PdfPermissions pValue, const bufferview& uValue, const bufferview& oValue,
383 bool encryptedMetadata);
384
389 void InitFromScratch(const std::string_view& userPassword, const std::string_view& ownerPassword,
390 PdfEncryptionAlgorithm algorithm, PdfKeyLength keyLength, unsigned char revision,
391 PdfPermissions pValue, bool encryptedMetadata);
392
393 virtual void Decrypt(const char* inStr, size_t inLen, PdfEncryptContext& context,
394 const PdfReference& objref, char* outStr, size_t& outLen) const = 0;
395
396 virtual void Encrypt(const char* inStr, size_t inLen, PdfEncryptContext& context,
397 const PdfReference& objref, char* outStr, size_t outLen) const = 0;
398
399 virtual PdfAuthResult Authenticate(const std::string_view& password, const std::string_view& documentId,
400 PODOFO_CRYPT_CTX* ctx, unsigned char encryptionKey[32]) const = 0;
401
402 virtual void GenerateEncryptionKey(
403 const std::string_view& documentId, PdfAuthResult authResult, PODOFO_CRYPT_CTX* ctx,
404 unsigned char uValue[48], unsigned char oValue[48], unsigned char encryptionKey[32]) = 0;
405
406 // Check two keys for equality
407 bool CheckKey(const unsigned char key1[32], const unsigned char key2[32]) const;
408
409 enum class PdfRC4Revision : uint8_t
410 {
411 R2 = 2,
412 R3 = 3,
413 };
414
415 enum class PdfAESV3Revision : uint8_t
416 {
417 R5 = 5,
418 R6 = 6,
419 };
420
421private:
422 PdfEncrypt();
423
424 PdfEncrypt(const PdfEncrypt& rhs) = default;
425
426 PdfEncrypt& operator=(PdfEncrypt& rhs) = delete;
427
428private:
429 static std::unique_ptr<PdfEncrypt> CreateFromEncrypt(const PdfEncrypt& rhs);
430
431 void clearSensitiveInfo();
432
433private:
434 PdfEncryptionAlgorithm m_Algorithm; // The used encryption algorithm
435 unsigned char m_rValue; // Revision
436 PdfKeyLength m_KeyLength; // The encryption key length, as enum value
437 PdfPermissions m_pValue; // P entry in pdf document
438 unsigned char m_uValue[48]; // U entry in pdf document
439 unsigned char m_oValue[48]; // O entry in pdf document
440 unsigned char m_uValueSize;
441 unsigned char m_oValueSize;
442 bool m_EncryptMetadata; // Is metadata encrypted
443 bool m_IsParsed; // True if the object is created from parsed values
444 bool m_initialized; // True if the object O/U values were filled
445 std::string m_userPass; // User password
446 std::string m_ownerPass; // Owner password
447
448};
449
450class PODOFO_API PdfEncryptContext final
451{
452 friend class PdfEncrypt;
453 friend class PdfEncryptRC4;
454 friend class PdfEncryptAESV2;
455 friend class PdfEncryptAESV3;
456
457public:
458 PdfEncryptContext();
459
460 ~PdfEncryptContext();
461
462 PdfEncryptContext(const PdfEncryptContext&);
463
464 PdfEncryptContext& operator=(const PdfEncryptContext&);
465
466public:
467 inline PdfAuthResult GetAuthResult() { return m_AuthResult; }
468
469 inline const std::string GetDocumentId() { return m_documentId; }
470
471 bool IsAuthenticated() const;
472
473private:
474 inline const unsigned char* GetEncryptionKey() const { return m_encryptionKey; }
475
476 PODOFO_CRYPT_CTX* GetCryptCtx();
477
478 template <typename T>
479 T& GetCustomCtx()
480 {
481 if (m_customCtx == nullptr)
482 {
483 m_customCtx = ::operator new(sizeof(T));
484 m_customCtxSize = sizeof(T);
485 }
486
487 return *(T*)m_customCtx;
488 }
489
490private:
491 unsigned char m_encryptionKey[32]; // Encryption key
492 std::string m_documentId; // DocumentID of the current document
493 PdfAuthResult m_AuthResult;
494 PODOFO_CRYPT_CTX* m_cryptCtx;
495 void* m_customCtx;
496 size_t m_customCtxSize;
497};
498
499
508{
509 friend class PdfEncryptRC4;
510 friend class PdfEncryptAESV2;
511
512private:
514
516
517public:
519
520 // NOTE: We must declare again without body otherwise the other Authenticate overload hides it
521 PdfAuthResult Authenticate(const std::string_view& password, const std::string_view& documentId,
522 PODOFO_CRYPT_CTX* ctx, unsigned char encryptionKey[32]) const override = 0;
523
524protected:
525 // Compute owner key
526 static void ComputeOwnerKey(const unsigned char userPad[32], const unsigned char ownerPad[32],
527 unsigned keylength, unsigned revision, bool authenticate, PODOFO_CRYPT_CTX* ctx, unsigned char ownerKey[32]);
528
529 // Pad a password to 32 characters
530 static void PadPassword(const std::string_view& password, unsigned char pswd[32]);
531
532 // Compute encryption key and user key
533 static void ComputeEncryptionKey(const std::string_view& documentID,
534 const unsigned char userPad[32], const unsigned char ownerKey[32],
535 PdfPermissions pValue, unsigned keyLength, unsigned revision,
536 bool encryptMetadata, PODOFO_CRYPT_CTX* ctx,
537 unsigned char userKey[32], unsigned char encryptionKey[32]);
538
544 void CreateObjKey(unsigned char objkey[16], unsigned& pnKeyLen,
545 const unsigned char m_encryptionKey[32], const PdfReference& objref) const;
546};
547
555{
556 friend class PdfEncrypt;
557
558private:
560 PdfEncryptAESV2(const std::string_view& userPassword, const std::string_view& ownerPassword,
563
564public:
565 std::unique_ptr<InputStream> CreateEncryptionInputStream(InputStream& inputStream, size_t inputLen,
566 PdfEncryptContext& context, const PdfReference& objref) const override;
567 std::unique_ptr<OutputStream> CreateEncryptionOutputStream(OutputStream& outputStream,
568 PdfEncryptContext& context, const PdfReference& objref) const override;
569
570 size_t CalculateStreamOffset() const override;
571
572 size_t CalculateStreamLength(size_t length) const override;
573
574protected:
575 void Encrypt(const char* inStr, size_t inLen, PdfEncryptContext& context,
576 const PdfReference& objref, char* outStr, size_t outLen) const override;
577 void Decrypt(const char* inStr, size_t inLen, PdfEncryptContext& context,
578 const PdfReference& objref, char* outStr, size_t& outLen) const override;
579
580 void GenerateEncryptionKey(const std::string_view& documentId, PdfAuthResult authResult, PODOFO_CRYPT_CTX* ctx,
581 unsigned char uValue[48], unsigned char oValue[48], unsigned char encryptionKey[32]) override;
582
583 PdfAuthResult Authenticate(const std::string_view& password, const std::string_view& documentId,
584 PODOFO_CRYPT_CTX* ctx, unsigned char encryptionKey[32]) const override;
585
586private:
587 void generateInitialVector(const std::string_view& documentId, unsigned char iv[]) const;
588};
589
597{
598 friend class PdfEncrypt;
599
600private:
602 PdfPermissions pValue, PdfString permsValue, PdfAESV3Revision rev);
603 PdfEncryptAESV3(const std::string_view& userPassword, const std::string_view& ownerPassword,
604 PdfAESV3Revision rev, PdfPermissions protection);
606
607public:
608 std::unique_ptr<InputStream> CreateEncryptionInputStream(InputStream& inputStream, size_t inputLen,
609 PdfEncryptContext& context, const PdfReference& objref) const override;
610 std::unique_ptr<OutputStream> CreateEncryptionOutputStream(OutputStream& outputStream,
611 PdfEncryptContext& context, const PdfReference& objref) const override;
612
613 size_t CalculateStreamOffset() const override;
614
615 size_t CalculateStreamLength(size_t length) const override;
616
618
619 // Get the UE object value (user)
620 bufferview GetUEValue() const;
621
622 // Get the OE object value (owner)
623 bufferview GetOEValue() const;
624
625 // Get the Perms object value (encrypted protection)
626 bufferview GetPermsValue() const;
627
628protected:
629 // Encrypt a character string
630 void Encrypt(const char* inStr, size_t inLen, PdfEncryptContext& context,
631 const PdfReference& objref, char* outStr, size_t outLen) const override;
632 void Decrypt(const char* inStr, size_t inLen, PdfEncryptContext& context,
633 const PdfReference& objref, char* outStr, size_t& outLen) const override;
634
635 PdfAuthResult Authenticate(const std::string_view& password, const std::string_view& documentId,
636 PODOFO_CRYPT_CTX* ctx, unsigned char encryptionKey[32]) const override;
637
638 void GenerateEncryptionKey(const std::string_view& documentId, PdfAuthResult authResult, PODOFO_CRYPT_CTX* ctx,
639 unsigned char uValue[48], unsigned char oValue[48], unsigned char encryptionKey[32]) override;
640
641private:
642 // Generate initial vector
643 static void generateInitialVector(unsigned char iv[]);
644
645 // Preprocess password for use in EAS-256 Algorithm
646 // outBuf needs to be at least 127 bytes long
647 static void preprocessPassword(const std::string_view& password, unsigned char* outBuf, unsigned& len);
648
649 // Compute encryption key to be used with AES-256
650 static void computeEncryptionKey(unsigned keyLength, unsigned char encryptionKey[32]);
651
652 // Compute hash for password and salt with optional uValue
653 static void computeHash(const unsigned char* pswd, unsigned pswdLen, unsigned revision,
654 const unsigned char salt[8], const unsigned char uValue[48], unsigned char hashValue[32]);
655
656 // Generate the U and UE entries
657 static void computeUserKey(const unsigned char* userpswd, unsigned len, unsigned revision,
658 unsigned keyLength, const unsigned char encryptionKey[32],
659 unsigned char uValue[48], unsigned char ueValue[32]);
660
661 // Generate the O and OE entries
662 static void computeOwnerKey(const unsigned char* userpswd, unsigned len, unsigned revision,
663 unsigned keyLength, const unsigned char encryptionKey[32], const unsigned char uValue[48],
664 unsigned char oValue[48], unsigned char oeValue[32]);
665
666private:
667 unsigned char m_ueValue[32]; // UE entry in pdf document
668 unsigned char m_oeValue[32]; // OE entry in pdf document
669 unsigned char m_permsValue[16]; // Perms entry in pdf document
670};
671
679{
680 friend class PdfEncrypt;
681
682private:
685 unsigned keyLength, bool encryptMetadata);
686 PdfEncryptRC4(const std::string_view& userPassword, const std::string_view& ownerPassword,
690 PdfEncryptRC4(const PdfEncryptRC4& rhs) = default;
691
692public:
693 std::unique_ptr<InputStream> CreateEncryptionInputStream(InputStream& inputStream, size_t inputLen,
694 PdfEncryptContext& context, const PdfReference& objref) const override;
695
696 std::unique_ptr<OutputStream> CreateEncryptionOutputStream(OutputStream& outputStream,
697 PdfEncryptContext& context, const PdfReference& objref) const override;
698
699 size_t CalculateStreamOffset() const override;
700
701 size_t CalculateStreamLength(size_t length) const override;
702
703protected:
704 void Encrypt(const char* inStr, size_t inLen, PdfEncryptContext& context,
705 const PdfReference& objref, char* outStr, size_t outLen) const override;
706
707 void Decrypt(const char* inStr, size_t inLen, PdfEncryptContext& context,
708 const PdfReference& objref, char* outStr, size_t& outLen) const override;
709
710 void GenerateEncryptionKey(const std::string_view& documentId, PdfAuthResult authResult, PODOFO_CRYPT_CTX* ctx,
711 unsigned char uValue[48], unsigned char oValue[48], unsigned char encryptionKey[32]) override;
712
713 PdfAuthResult Authenticate(const std::string_view& password, const std::string_view& documentId,
714 PODOFO_CRYPT_CTX* ctx, unsigned char encryptionKey[32]) const override;
715
716private:
717 static unsigned normalizeKeyLength(unsigned keyLength);
718};
719
720}
721ENABLE_BITMASK_OPERATORS(PoDoFo::PdfPermissions);
722ENABLE_BITMASK_OPERATORS(PoDoFo::PdfEncryptionAlgorithm);
723
724#endif // PDF_ENCRYPT_H
An interface for reading blocks of data from a data source.
Definition InputStream.h:20
An interface for writing blocks of data to a data source.
Definition OutputStream.h:18
The PDF dictionary data type of PoDoFo (inherits from PdfDataContainer, the base class for such repre...
Definition PdfDictionary.h:82
A class that is used to encrypt a PDF file (AES-128)
Definition PdfEncrypt.h:555
size_t CalculateStreamLength(size_t length) const override
Calculate stream size.
Definition PdfEncrypt.cpp:1380
std::unique_ptr< OutputStream > CreateEncryptionOutputStream(OutputStream &outputStream, PdfEncryptContext &context, const PdfReference &objref) const override
Create an OutputStream that encrypts all data written to it using the current settings of the PdfEncr...
Definition PdfEncrypt.cpp:1398
std::unique_ptr< InputStream > CreateEncryptionInputStream(InputStream &inputStream, size_t inputLen, PdfEncryptContext &context, const PdfReference &objref) const override
Create an InputStream that decrypts all data read from it using the current settings of the PdfEncryp...
Definition PdfEncrypt.cpp:1389
size_t CalculateStreamOffset() const override
Calculate stream offset.
Definition PdfEncrypt.cpp:1321
A class that is used to encrypt a PDF file (AES-256)
Definition PdfEncrypt.h:597
std::unique_ptr< InputStream > CreateEncryptionInputStream(InputStream &inputStream, size_t inputLen, PdfEncryptContext &context, const PdfReference &objref) const override
Create an InputStream that decrypts all data read from it using the current settings of the PdfEncryp...
Definition PdfEncrypt.cpp:1896
size_t CalculateStreamLength(size_t length) const override
Calculate stream size.
Definition PdfEncrypt.cpp:1887
void CreateEncryptionDictionary(PdfDictionary &dictionary) const override
Fill all keys into a encryption dictionary.
Definition PdfEncrypt.cpp:1623
std::unique_ptr< OutputStream > CreateEncryptionOutputStream(OutputStream &outputStream, PdfEncryptContext &context, const PdfReference &objref) const override
Create an OutputStream that encrypts all data written to it using the current settings of the PdfEncr...
Definition PdfEncrypt.cpp:1903
size_t CalculateStreamOffset() const override
Calculate stream offset.
Definition PdfEncrypt.cpp:1807
A pure virtual class that is used to encrypt a PDF file (RC4, AES-128) This class is the base for cla...
Definition PdfEncrypt.h:508
void CreateObjKey(unsigned char objkey[16], unsigned &pnKeyLen, const unsigned char m_encryptionKey[32], const PdfReference &objref) const
Create the encryption key for the current object.
Definition PdfEncrypt.cpp:889
void CreateEncryptionDictionary(PdfDictionary &dictionary) const override
Fill all keys into a encryption dictionary.
Definition PdfEncrypt.cpp:960
A class that is used to encrypt a PDF file (RC4 40-bit and 128-bit)
Definition PdfEncrypt.h:679
size_t CalculateStreamOffset() const override
Calculate stream offset.
Definition PdfEncrypt.cpp:1075
std::unique_ptr< OutputStream > CreateEncryptionOutputStream(OutputStream &outputStream, PdfEncryptContext &context, const PdfReference &objref) const override
Create an OutputStream that encrypts all data written to it using the current settings of the PdfEncr...
Definition PdfEncrypt.cpp:1191
std::unique_ptr< InputStream > CreateEncryptionInputStream(InputStream &inputStream, size_t inputLen, PdfEncryptContext &context, const PdfReference &objref) const override
Create an InputStream that decrypts all data read from it using the current settings of the PdfEncryp...
Definition PdfEncrypt.cpp:1101
size_t CalculateStreamLength(size_t length) const override
Calculate stream size.
Definition PdfEncrypt.cpp:1080
A bundle of the encrypt object together a context.
Definition PdfEncryptSession.h:18
A class that is used to encrypt a PDF file and set document permissions on the PDF file.
Definition PdfEncrypt.h:118
virtual size_t CalculateStreamLength(size_t length) const =0
Calculate stream size.
unsigned GetRevision() const
Get the revision number of the encryption method.
Definition PdfEncrypt.h:360
virtual size_t CalculateStreamOffset() const =0
Calculate stream offset.
virtual std::unique_ptr< OutputStream > CreateEncryptionOutputStream(OutputStream &outputStream, PdfEncryptContext &context, const PdfReference &objref) const =0
Create an OutputStream that encrypts all data written to it using the current settings of the PdfEncr...
void Authenticate(const std::string_view &password, const PdfString &documentId, PdfEncryptContext &context) const
Tries to authenticate a user using either the user or owner password.
virtual std::unique_ptr< InputStream > CreateEncryptionInputStream(InputStream &inputStream, size_t inputLen, PdfEncryptContext &context, const PdfReference &objref) const =0
Create an InputStream that decrypts all data read from it using the current settings of the PdfEncryp...
PdfPermissions GetPValue() const
Get the P object value (protection)
Definition PdfEncrypt.h:356
virtual void CreateEncryptionDictionary(PdfDictionary &dictionary) const =0
Fill all keys into a encryption dictionary.
PdfKeyLength GetKeyLength() const
Get the length of the encryption key in bits.
Definition PdfEncrypt.h:352
PdfEncryptionAlgorithm GetEncryptAlgorithm() const
Get the encryption algorithm of this object.
Definition PdfEncrypt.h:235
This class represents a PDF indirect Object in memory.
Definition PdfObject.h:35
A reference is a pointer to a object in the PDF file of the form "4 0 R", where 4 is the object numbe...
Definition PdfReference.h:24
A string that can be written to a PDF document.
Definition PdfString.h:24
Convenient type for char array storage and/or buffer with std::string compatibility.
Definition basetypes.h:38
SPDX-FileCopyrightText: (C) 2022 Francesco Pretto ceztko@gmail.com SPDX-License-Identifier: LGPL-2....
Definition basetypes.h:16
PdfEncryptionAlgorithm
The encryption algorithm.
Definition PdfEncrypt.h:88
@ AESV3R5
AES encryption with a 256 bit key (PDF1.7 extension 3, deprecated in PDF 2.0)
@ AESV3R6
AES encryption with a 256 bit key, Revision 6 (PDF1.7 extension 8, PDF 2.0)
@ AESV2
AES encryption with a 128 bit key (PDF1.6)
@ RC4V1
RC4 Version 1 encryption using a 40bit key.
@ RC4V2
RC4 Version 2 encryption using a key with 40-128bit.
@ None
Do not add a default appearrance.
@ Create
Create a new file or truncate existing one for writing/reading.
cspan< char > bufferview
Convenient read-only char buffer span.
Definition basetypes.h:19
PdfPermissions
Set user permissions/restrictions on a document.
Definition PdfEncrypt.h:64
@ FillAndSign
Fill in existing form or signature fields.
@ HighPrint
Print a high resolution version of the document.
@ Copy
Allow text and graphic extraction.
@ DocAssembly
Assemble the document: insert, create, rotate delete pages or add bookmarks.
@ Edit
Allow modifying the document besides annotations, form fields or changing pages.
@ EditNotes
Add or modify text annotations or form fields (if PdfPermissions::Edit is set also allow to create in...
@ Accessible
Extract text and graphics to support user with disabilities.
PdfKeyLength
A enum specifying a valid keylength for a PDF encryption key.
Definition PdfEncrypt.h:41
PdfAuthResult
Definition PdfEncrypt.h:98
@ User
Success authenticating a user for this PDF.
@ Owner
Success authenticating the owner for this PDF.
@ Failed
Failed to authenticate to this PDF.