CIB pdf toolbox 2 technical documentation

4. Usecases

4.10. Encryption

Writing a document with encryption

Property

Meaning

Type

OutputOwnerPassword

Setting the owner password. This means, that the document gets encrypted, but unless you also specify a user password, anyone can view the document without a password entry, but the security options apply.

Set

OutputUserPassword

Setting the user password. When this is set, someone who opens the document will need to enter either a user or owner password to open the document.

Set

EncryptEnablePrinting

A flag indicating if a user has the right to print the document.

Get/Set

EncryptEnableClipboard

A flag indicating if a user has the right to copy content to the clipboard.

Get/Set

EncryptEnableForms

A flag indicating if a user has the right to fill out form fields.

Get/Set

EncryptEnableAssembling

A flag indicating if a user has the right to assemble the document (rotate, delete, insert,…).

Get/Set

EncryptEnableNotes

A flag indicating if a user has the right to add or modify text annotations.

Get/Set

EncryptEnableModifying

A flag indicating if a user has the right to do other modifying operations on the document.

Get/Set

EncryptEnableExtract

A flag indicating if a user has the right to extract text and graphics (in support of accessibility to users with disabilities or for other purposes).

Get/Set

PdfVersion

The encryption algorithm is defined by the output pdf version. Always the best encryption standard, which is supported by the pdf version will be used. To use the highest and most secure encryption, please use always either PDF version 1.7EL8 or 2.0. This is AES-256 with fixes for the hashing algorithm, as defined in those two PDF versions. PDF 2.0 deprecated all other encryption variants, which were used before. 

Get/Set

 

Opening a document with encryption

You can either specify EncryptUserPassword or EncryptOwnerPassword, if you know if the provided password is a user or owner password or EncryptDocumentPassword. In the case of EncryptDocumentPassword it is internally checked, if the password is a user or owner password.

Property

Meaning

Type

EncryptUserPassword

The user password to open a document.

Set

EncryptOwnerPassword

The owner password to open a docuement.

Set

EncryptDocumentPassword

The user or owner password to open a document.

Set

PdfEncryptionOwnerAuthorized

After opening the document you can check by this flag, if you have owner or user access.

Get

EncryptEnable*

By reading the EncryptEnable* properties (see section above) you can read, which security rights the document has.

Get

 

Removing Encryption from an input document

Property

Meaning

Type

RemoveEncryption

A flag, that indicates, that encryption should be removed. You need to authorize at first to be able to remove encryption. When you write the document afterwards, it will not contain any encryption.

Set