How to set 'permission' and 'open' passwords?

Q:

Using Adobe Acrobat 8, we can set separate passwords: one for File
Open and
another for three modes for Document editing/printing. Is this
facility available in PDFTron PDFNet SDK ?
----
A:

Standard PDF security handler supports two passwords:
   master/owner/permission password, and user/open password.

You can set these passwords using ChangeMasterPassword() and
ChangeUserPassword() in StdSecurityHandler.

For example:

// C# sample code

// Apply a new security handler with given security settings.
// In order to open saved PDF you will need a user password 'test'.
StdSecurityHandler new_handler = new StdSecurityHandler();

// Set a new password required to open a document
string user_pass = "pass1";
string owner_pass = "pass2";
new_handler.ChangeUserPassword(new
System.Text.UTF8Encoding().GetBytes(user_pass));
new_handler.ChangeMasterPassword (new
System.Text.UTF8Encoding().GetBytes(owner_pass));

// Set Permissions
new_handler.SetPermission (SecurityHandler.Permission.e_print, true);
new_handler.SetPermission
(SecurityHandler.Permission.e_extract_content, false);
..

doc.SetSecurityHandler(new_handler);