PoDoFo  1.0.0-dev
Public Member Functions | Protected Member Functions | Friends | List of all members
PoDoFo::PdfEncryptRC4 Class Referencefinal

A class that is used to encrypt a PDF file (RC4 40-bit and 128-bit) More...

#include <PdfEncrypt.h>

Inherits PoDoFo::PdfEncryptMD5Base.

Public Member Functions

std::unique_ptr< InputStreamCreateEncryptionInputStream (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 PdfEncrypt object. More...
 
std::unique_ptr< OutputStreamCreateEncryptionOutputStream (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 PdfEncrypt object. More...
 
size_t CalculateStreamOffset () const override
 Calculate stream offset.
 
size_t CalculateStreamLength (size_t length) const override
 Calculate stream size.
 

Protected Member Functions

void Encrypt (const char *inStr, size_t inLen, PdfEncryptContext &context, const PdfReference &objref, char *outStr, size_t outLen) const override
 
void Decrypt (const char *inStr, size_t inLen, PdfEncryptContext &context, const PdfReference &objref, char *outStr, size_t &outLen) const override
 
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]) override
 
PdfAuthResult Authenticate (const std::string_view &password, const std::string_view &documentId, PODOFO_CRYPT_CTX *ctx, unsigned char encryptionKey[32]) const override
 

Friends

class PdfEncrypt
 

Detailed Description

A class that is used to encrypt a PDF file (RC4 40-bit and 128-bit)

Client code is working only with PdfEncrypt class and knows nothing about PdfEncryptRC4, it is created through CreatePdfEncrypt factory method

Member Function Documentation

◆ CreateEncryptionInputStream()

unique_ptr< InputStream > PdfEncryptRC4::CreateEncryptionInputStream ( InputStream inputStream,
size_t  inputLen,
PdfEncryptContext &  context,
const PdfReference objref 
) const
overridevirtual

Create an InputStream that decrypts all data read from it using the current settings of the PdfEncrypt object.

Warning: Currently only RC4 based encryption is supported using output streams!

Parameters
inputStreamthe created InputStream reads all decrypted data to this input stream.
Returns
an InputStream that decrypts all data.

Implements PoDoFo::PdfEncrypt.

◆ CreateEncryptionOutputStream()

unique_ptr< OutputStream > PdfEncryptRC4::CreateEncryptionOutputStream ( OutputStream outputStream,
PdfEncryptContext &  context,
const PdfReference objref 
) const
overridevirtual

Create an OutputStream that encrypts all data written to it using the current settings of the PdfEncrypt object.

Warning: Currently only RC4 based encryption is supported using output streams!

Parameters
outputStreamthe created OutputStream writes all encrypted data to this output stream.
Returns
a OutputStream that encrypts all data.

Implements PoDoFo::PdfEncrypt.


The documentation for this class was generated from the following files: