A pure virtual class that is used to encrypt a PDF file (RC4, AES-128) This class is the base for classes that implement algorithms based on MD5 hashes.
More...
|
void | CreateEncryptionDictionary (PdfDictionary &dictionary) const override |
| Fill all keys into a encryption dictionary.
|
|
PdfAuthResult | Authenticate (const std::string_view &password, const std::string_view &documentId, PODOFO_CRYPT_CTX *ctx, unsigned char encryptionKey[32]) const override=0 |
|
void | EnsureEncryptionInitialized (const PdfString &documentId, PdfEncryptContext &context) |
| Ensure encryption key and /O, /U, /OE, /UE values are initialized.
|
|
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 PdfEncrypt object.
|
|
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 PdfEncrypt object.
|
|
PdfEncryptionAlgorithm | GetEncryptAlgorithm () const |
| Get the encryption algorithm of this object.
|
|
bool | IsOwnerPasswordSet () const |
| Checks if an owner password is set.
|
|
bool | IsPrintAllowed () const |
| Checks if printing this document is allowed.
|
|
bool | IsEditAllowed () const |
| Checks if modifying this document (besides annotations, form fields or changing pages) is allowed.
|
|
bool | IsCopyAllowed () const |
| Checks if text and graphics extraction is allowed.
|
|
bool | IsEditNotesAllowed () const |
| Checks if it is allowed to add or modify annotations or form fields Every PDF consuming applications has to adhere this value!
|
|
bool | IsFillAndSignAllowed () const |
| Checks if it is allowed to fill in existing form or signature fields Every PDF consuming applications has to adhere this value!
|
|
bool | IsAccessibilityAllowed () const |
| Checks if it is allowed to extract text and graphics to support users with disabilities Every PDF consuming applications has to adhere this value!
|
|
bool | IsDocAssemblyAllowed () const |
| Checks if it is allowed to insert, create, rotate, delete pages or add bookmarks Every PDF consuming applications has to adhere this value!
|
|
bool | IsHighPrintAllowed () const |
| Checks if it is allowed to print a high quality version of this document Every PDF consuming applications has to adhere this value!
|
|
void | EncryptTo (charbuff &out, const bufferview &view, PdfEncryptContext &context, const PdfReference &objref) const |
| Encrypt a character span.
|
|
void | DecryptTo (charbuff &out, const bufferview &view, PdfEncryptContext &context, const PdfReference &objref) const |
| Decrypt a character span.
|
|
virtual size_t | CalculateStreamLength (size_t length) const =0 |
| Calculate stream size.
|
|
virtual size_t | CalculateStreamOffset () const =0 |
| Calculate stream offset.
|
|
unsigned | GetKeyLengthBytes () const |
| Get the encryption key length in bytes.
|
|
bufferview | GetUValue () const |
| Get the U object value (user)
|
|
bufferview | GetOValue () const |
| Get the O object value (owner)
|
|
PdfKeyLength | GetKeyLength () const |
| Get the length of the encryption key in bits.
|
|
PdfPermissions | GetPValue () const |
| Get the P object value (protection)
|
|
unsigned | GetRevision () const |
| Get the revision number of the encryption method.
|
|
bool | IsMetadataEncrypted () const |
|
bool | IsParsed () const |
|
|
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.
|
|
const unsigned char * | GetUValueRaw () const |
|
const unsigned char * | GetOValueRaw () const |
|
const std::string & | GetUserPassword () const |
|
const std::string & | GetOwnerPassword () const |
|
int64_t | GetPValueForSerialization () const |
|
void | InitFromValues (PdfEncryptionAlgorithm algorithm, PdfKeyLength keyLength, unsigned char revision, PdfPermissions pValue, const bufferview &uValue, const bufferview &oValue, bool encryptedMetadata) |
| Init from parsed values.
|
|
void | InitFromScratch (const std::string_view &userPassword, const std::string_view &ownerPassword, PdfEncryptionAlgorithm algorithm, PdfKeyLength keyLength, unsigned char revision, PdfPermissions pValue, bool encryptedMetadata) |
| Init from scratch with user/owner password.
|
|
virtual void | Decrypt (const char *inStr, size_t inLen, PdfEncryptContext &context, const PdfReference &objref, char *outStr, size_t &outLen) const =0 |
|
virtual void | Encrypt (const char *inStr, size_t inLen, PdfEncryptContext &context, const PdfReference &objref, char *outStr, size_t outLen) const =0 |
|
virtual void | GenerateEncryptionKey (const std::string_view &documentId, PdfAuthResult authResult, PODOFO_CRYPT_CTX *ctx, unsigned char uValue[48], unsigned char oValue[48], unsigned char encryptionKey[32])=0 |
|
bool | CheckKey (const unsigned char key1[32], const unsigned char key2[32]) const |
|
A pure virtual class that is used to encrypt a PDF file (RC4, AES-128) This class is the base for classes that implement algorithms based on MD5 hashes.
Client code is working only with PdfEncrypt class and knows nothing about PdfEncrypt*, it is created through CreatePdfEncrypt factory method