Skip to main content
Skip table of contents

PdfEncryption

PdfEncryption Public class

Diagram

  flowchart LR
  classDef interfaceStyle stroke-dasharray: 5 5;
  classDef abstractStyle stroke-width:4px
  subgraph iTextSharp.text.pdf
  iTextSharp.text.pdf.PdfEncryption[[PdfEncryption]]
  end

Members

Methods

Public methods
ReturnsName
voidAddRecipient(X509Certificate cert, int permission)
intCalculateStreamSize(int n)
byte``[]ComputeUserPassword(byte``[] ownerPassword)
byte``[]DecryptByteArray(byte``[] b)
byte``[]EncryptByteArray(byte``[] b)
intGetCryptoMode()
StandardDecryptionGetDecryptor()
PdfDictionaryGetEncryptionDictionary()
OutputStreamEncryptionGetEncryptionStream(Stream os)
PdfObjectGetFileID(bool modified)
longGetPermissions()
boolIsEmbeddedFilesOnly()
boolIsMetadataEncrypted()
boolReadKey(PdfDictionary enc, byte``[] password)
voidSetCryptoMode(int mode, int kl)
voidSetHashKey(int number, int generation)
voidSetKey(byte``[] key)
voidSetupAllKeys(byte``[] userPassword, byte``[] ownerPassword, int permissions)
voidSetupByEncryptionKey(byte``[] key, int keylength)
voidSetupByOwnerPassword(byte``[] documentID, byte``[] ownerPassword, byte``[] userKey, byte``[] ownerKey, long permissions)
voidSetupByUserPassword(byte``[] documentID, byte``[] userPassword, byte``[] ownerKey, long permissions)
Public Static methods
ReturnsName
byte``[]CreateDocumentId()
PdfObjectCreateInfoId(byte``[] id, bool modified)

Details

Constructors

PdfEncryption [1/2]

Source code

public PdfEncryption()
PdfEncryption [2/2]

Source code

public PdfEncryption(PdfEncryption enc)
Arguments
TypeNameDescription
PdfEncryptionenc

Methods

SetCryptoMode

Source code

public virtual void SetCryptoMode(int mode, int kl)
Arguments
TypeNameDescription
intmode
intkl
GetCryptoMode

Source code

public virtual int GetCryptoMode()
IsMetadataEncrypted

Source code

public virtual bool IsMetadataEncrypted()
GetPermissions

Source code

public virtual long GetPermissions()
IsEmbeddedFilesOnly

Source code

public virtual bool IsEmbeddedFilesOnly()
SetupAllKeys

Source code

public virtual void SetupAllKeys(byte[] userPassword, byte[] ownerPassword, int permissions)
Arguments
TypeNameDescription
byte``[]userPassword
byte``[]ownerPassword
intpermissions
ReadKey

Source code

public virtual bool ReadKey(PdfDictionary enc, byte[] password)
Arguments
TypeNameDescription
PdfDictionaryenc
byte``[]password
CreateDocumentId

Source code

public static byte CreateDocumentId()
SetupByUserPassword

Source code

public virtual void SetupByUserPassword(byte[] documentID, byte[] userPassword, byte[] ownerKey, long permissions)
Arguments
TypeNameDescription
byte``[]documentID
byte``[]userPassword
byte``[]ownerKey
longpermissions
SetupByOwnerPassword

Source code

public virtual void SetupByOwnerPassword(byte[] documentID, byte[] ownerPassword, byte[] userKey, byte[] ownerKey, long permissions)
Arguments
TypeNameDescription
byte``[]documentID
byte``[]ownerPassword
byte``[]userKey
byte``[]ownerKey
longpermissions
SetKey

Source code

public virtual void SetKey(byte[] key)
Arguments
TypeNameDescription
byte``[]key
SetupByEncryptionKey

Source code

public virtual void SetupByEncryptionKey(byte[] key, int keylength)
Arguments
TypeNameDescription
byte``[]key
intkeylength
SetHashKey

Source code

public virtual void SetHashKey(int number, int generation)
Arguments
TypeNameDescription
intnumber
intgeneration
CreateInfoId

Source code

public static PdfObject CreateInfoId(byte[] id, bool modified)
Arguments
TypeNameDescription
byte``[]id
boolmodified
GetEncryptionDictionary

Source code

public virtual PdfDictionary GetEncryptionDictionary()
GetFileID

Source code

public virtual PdfObject GetFileID(bool modified)
Arguments
TypeNameDescription
boolmodified
GetEncryptionStream

Source code

public virtual OutputStreamEncryption GetEncryptionStream(Stream os)
Arguments
TypeNameDescription
Streamos
CalculateStreamSize

Source code

public virtual int CalculateStreamSize(int n)
Arguments
TypeNameDescription
intn
EncryptByteArray

Source code

public virtual byte EncryptByteArray(byte[] b)
Arguments
TypeNameDescription
byte``[]b
GetDecryptor

Source code

public virtual StandardDecryption GetDecryptor()
DecryptByteArray

Source code

public virtual byte DecryptByteArray(byte[] b)
Arguments
TypeNameDescription
byte``[]b
AddRecipient

Source code

public virtual void AddRecipient(X509Certificate cert, int permission)
Arguments
TypeNameDescription
X509Certificatecert
intpermission
ComputeUserPassword

Source code

public virtual byte ComputeUserPassword(byte[] ownerPassword)
Arguments
TypeNameDescription
byte``[]ownerPassword

Generated with ModularDoc

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.