iText 5

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

Returns

Name

void

AddRecipient

(X509Certificate cert, int permission)

int

CalculateStreamSize

(int n)

byte``[]

ComputeUserPassword

(byte``[] ownerPassword)

byte``[]

DecryptByteArray

(byte``[] b)

byte``[]

EncryptByteArray

(byte``[] b)

int

GetCryptoMode

()

StandardDecryption

GetDecryptor

()

PdfDictionary

GetEncryptionDictionary

()

OutputStreamEncryption

GetEncryptionStream

(Stream os)

PdfObject

GetFileID

(bool modified)

long

GetPermissions

()

bool

IsEmbeddedFilesOnly

()

bool

IsMetadataEncrypted

()

bool

ReadKey

(

PdfDictionary

enc, byte``[] password)

void

SetCryptoMode

(int mode, int kl)

void

SetHashKey

(int number, int generation)

void

SetKey

(byte``[] key)

void

SetupAllKeys

(byte``[] userPassword, byte``[] ownerPassword, int permissions)

void

SetupByEncryptionKey

(byte``[] key, int keylength)

void

SetupByOwnerPassword

(byte``[] documentID, byte``[] ownerPassword, byte``[] userKey, byte``[] ownerKey, long permissions)

void

SetupByUserPassword

(byte``[] documentID, byte``[] userPassword, byte``[] ownerKey, long permissions)

Public Static methods

Returns

Name

byte``[]

CreateDocumentId

()

PdfObject

CreateInfoId

(byte``[] id, bool modified)

Details

Constructors

PdfEncryption [1/2]

Source code

public PdfEncryption()

PdfEncryption [2/2]

Source code

public PdfEncryption(PdfEncryption enc)

Arguments

Type

Name

Description

PdfEncryption

enc

Methods

SetCryptoMode

Source code

public virtual void SetCryptoMode(int mode, int kl)

Arguments

Type

Name

Description

int

mode

int

kl

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

Type

Name

Description

byte``[]

userPassword

byte``[]

ownerPassword

int

permissions

ReadKey

Source code

public virtual bool ReadKey(PdfDictionary enc, byte[] password)

Arguments

Type

Name

Description

PdfDictionary

enc

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

Type

Name

Description

byte``[]

documentID

byte``[]

userPassword

byte``[]

ownerKey

long

permissions

SetupByOwnerPassword

Source code

public virtual void SetupByOwnerPassword(byte[] documentID, byte[] ownerPassword, byte[] userKey, byte[] ownerKey, long permissions)

Arguments

Type

Name

Description

byte``[]

documentID

byte``[]

ownerPassword

byte``[]

userKey

byte``[]

ownerKey

long

permissions

SetKey

Source code

public virtual void SetKey(byte[] key)

Arguments

Type

Name

Description

byte``[]

key

SetupByEncryptionKey

Source code

public virtual void SetupByEncryptionKey(byte[] key, int keylength)

Arguments

Type

Name

Description

byte``[]

key

int

keylength

SetHashKey

Source code

public virtual void SetHashKey(int number, int generation)

Arguments

Type

Name

Description

int

number

int

generation

CreateInfoId

Source code

public static PdfObject CreateInfoId(byte[] id, bool modified)

Arguments

Type

Name

Description

byte``[]

id

bool

modified

GetEncryptionDictionary

Source code

public virtual PdfDictionary GetEncryptionDictionary()

GetFileID

Source code

public virtual PdfObject GetFileID(bool modified)

Arguments

Type

Name

Description

bool

modified

GetEncryptionStream

Source code

public virtual OutputStreamEncryption GetEncryptionStream(Stream os)

Arguments

Type

Name

Description

Stream

os

CalculateStreamSize

Source code

public virtual int CalculateStreamSize(int n)

Arguments

Type

Name

Description

int

n

EncryptByteArray

Source code

public virtual byte EncryptByteArray(byte[] b)

Arguments

Type

Name

Description

byte``[]

b

GetDecryptor

Source code

public virtual StandardDecryption GetDecryptor()

DecryptByteArray

Source code

public virtual byte DecryptByteArray(byte[] b)

Arguments

Type

Name

Description

byte``[]

b

AddRecipient

Source code

public virtual void AddRecipient(X509Certificate cert, int permission)

Arguments

Type

Name

Description

X509Certificate

cert

int

permission

ComputeUserPassword

Source code

public virtual byte ComputeUserPassword(byte[] ownerPassword)

Arguments

Type

Name

Description

byte``[]

ownerPassword

Generated with ModularDoc