Logo Search packages:      
Sourcecode: codeblocks version File versions  Download package

wxPdfEncrypt Class Reference

#include <pdfencrypt.h>

List of all members.


Detailed Description

Class representing PDF encryption methods. (For internal use only).

Definition at line 24 of file pdfencrypt.h.


Public Member Functions

bool Authenticate (const wxString &documentID, const wxString &password, const wxString &uValue, const wxString &oValue, int pValue, int lengthValue, int rValue)
int CalculateStreamLength (int length)
 Calculate stream size.
int CalculateStreamOffset ()
 Calculate stream offset.
wxString CreateDocumentId ()
 Create document id.
void Encrypt (int n, int g, unsigned char *str, int len)
 Encrypt a character string.
void Encrypt (int n, int g, wxString &str)
 Encrypt a wxString.
void GenerateEncryptionKey (const wxString &userPassword, const wxString &ownerPassword, int protection)
 Generate encryption key from user and owner passwords and protection key.
wxString GetDocumentId () const
 Get document id.
int GetKeyLength () const
 Get the key length of the encryption key in bits.
const unsigned char * GetOValue () const
 Get the O object value (owner).
int GetPValue () const
 Get the P object value (protection).
int GetRevision () const
 Get the revision number of the encryption method.
const unsigned char * GetUValue () const
 Get the U object value (user).
 wxPdfEncrypt (int revision=2, int keyLength=40)
 Default constructor.
virtual ~wxPdfEncrypt ()
 Default destructor.

Protected Member Functions

void AES (unsigned char *key, int WXUNUSED(keylen), unsigned char *textin, int textlen, unsigned char *textout)
 AES encryption.
bool CheckKey (unsigned char key1[32], unsigned char key2[32])
 Check two keys for equality.
void ComputeEncryptionKey (const wxString &documentID, unsigned char userPad[32], unsigned char ownerKey[32], int pValue, int keyLength, int revision, unsigned char userKey[32])
 Compute encryption key and user key.
void ComputeOwnerKey (unsigned char userPad[32], unsigned char ownerPad[32], int keylength, int revision, bool authenticate, unsigned char ownerKey[32])
 Compute owner key.
void GenerateInitialVector (unsigned char iv[16])
 Generate initial vector.
void GetMD5Binary (const unsigned char *data, int length, unsigned char *digest)
 Calculate the binary MD5 message digest of the given data.
void PadPassword (const wxString &password, unsigned char pswd[32])
 Pad a password to 32 characters.
void RC4 (unsigned char *key, int keylen, unsigned char *textin, int textlen, unsigned char *textout)
 RC4 encryption.

Private Attributes

wxPdfRijndaelm_aes
 AES encryptor.
wxString m_documentId
 Document ID.
unsigned char m_encryptionKey [16]
 Encryption key.
int m_keyLength
 Length of encryption key.
unsigned char m_oValue [32]
 O entry in pdf document.
int m_pValue
 P entry in pdf document.
unsigned char m_rc4key [16]
 last RC4 key
unsigned char m_rc4last [256]
 last RC4 state table
int m_rValue
 Revision.
unsigned char m_uValue [32]
 U entry in pdf document.

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

Generated by  Doxygen 1.6.0   Back to index