Click or drag to resize

SecurityHandler Class

Standard Security Handler is a built-in password-based security handler.
Inheritance Hierarchy

Namespace:  pdftron.SDF
Assembly:  pdftron (in pdftron.dll) Version:
public sealed class SecurityHandler : IClosable

The SecurityHandler type exposes the following members.

Public methodSecurityHandler
Create a standard security handler
Public methodSecurityHandler(SecurityHandler)
Create a standard security handler from a given handler
Public methodSecurityHandler(SecurityHandlerAlgorithmType)
Create a Standard Security Handler.
Public methodSecurityHandler(Int32, Int32)
Create a standard security handler
Public methodAuthorize
The method is called when a user tries to set security for an encrypted document and when a user tries to open a file. It must decide, based on the contents of the authorization data structure, whether or not the user is permitted to open the file, and what permissions the user has for this file.
Public methodAuthorizeFailed
A callback method indicating repeated failed authorization. Override this callback in order to provide a UI feedback for failed authorization. Default implementation returns immediately.
Public methodChangeMasterPassword(Byte)
Changes the master/owner password.
Public methodChangeMasterPassword(String)
Changes master password
Public methodChangeRevisionNumber
Changes revision number
Public methodChangeUserPassword(Byte)
Changes the user password.
Public methodChangeUserPassword(String)
Changes user password
Public methodClose
Public methodEditSecurityData
Called when the security handler should activate a dialog box with the current security settings that may be modified.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodFillEncryptDict
Fills the document's Encryption dictionary with whatever information the security handler wants to store in the document. The sequence of events during creation of the encrypt_dict is as follows:
  • encrypt_dict is created(if it does not exist)
  • Filter attribute is added to the dictionary
  • call this method to allow the security handler to add its own attributes
  • call the GetCryptKey to get the algorithm version, key, and key length
  • checks if the V attribute has been added to the dictionary and, if not, then sets V to the algorithm version
  • set the Length attribute if V is 2 or greater
  • add the encrypt_dict to the document
Public methodGetAuthorizationData
This method is invoked in case Authorize() failed.The callback must determine the user’s authorization properties for the document by obtaining authorization data(e.g. a password through a GUI dialog).The authorization data is subsequently used by the security handler’s Authorize() to determine whether or not the user is authorized to open the file.
Public methodGetEncryptionAlgorithmID
Gets the encryption algorithm id.
Public methodGetHandlerDocName
Gets the handler doc name.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetKeyLength
Gets the key length.
Public methodGetMasterPassword
Gets master password
Public methodGetPermission
Gets permission
Public methodGetRevisionNumber
Gets revision number
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetUserPassword
Gets user password
Public methodInitialize
Occurs when authorization fails
Public methodInitPassword(Byte)
Initializes the password.
Public methodInitPassword(String)
Clones instance of SecurityHandler.
Public methodIsAES
Checks if AES encryption algorithm is used
Public methodIsAES(Obj)
The following function can be used to verify whether a given stream is encrypted using AES.
Public methodIsMasterPasswordRequired
Checks if master password required
Public methodIsModified
If the user changes SecurityHandler's settings(e.g. by changing a password), IsModified() should return true.
Public methodIsRC4
Checks if RC4 encryption algorithm is used
Public methodIsUserPasswordRequired
Checks if user password required
Public methodSetEncryptMetadata
Sets whether to encrypt metadata
Public methodSetModified
The method allows derived classes to set SecurityHandler is modified flag. This method should be called whenever there are changes(e.g. a password change) to the SecurityHandler
Public methodSetModified(Boolean)
The method allows derived classes to set SecurityHandler is modified flag. This method should be called whenever there are changes(e.g. a password change) to the SecurityHandler
Public methodSetPermission
Set the permission setting of the StdSecurityHandler.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
See Also