org.icepdf.core.pobjects.security
Interface SecurityHandlerInterface

All Known Implementing Classes:
SecurityHandler, StandardSecurityHandler

public interface SecurityHandlerInterface

The interface for objects which defines a Security Handler for a PDF document. A custom Security Handlers should implement this interface.

Since:
1.1

Method Summary
 byte[] decrypt(Reference objectReference, byte[] encryptionKey, byte[] data)
          Decrypt the PDF data bytestream or string.
 void dispose()
          Dispose of the security handler.
 byte[] encrypt(Reference objectReference, byte[] encryptionKey, byte[] data)
          Encrypt the PDF data bytestream or string.
 byte[] getDecryptionKey()
          Gets the encryption key used by the security handler for decryption data.
 java.io.InputStream getEncryptionInputStream(Reference objectReference, byte[] encryptionKey, java.util.HashMap decodeParams, java.io.InputStream input)
           
 byte[] getEncryptionKey()
          Gets the encryption key used by the security handler for encrypting data.
 java.lang.String getHandlerName()
          Gets the name of the default security handler.
 Permissions getPermissions()
          Gets the PDF permissions object associated with this document's security handler.
 void init()
          Initiate the security handler
 boolean isAuthorized(java.lang.String password)
          Determines whether the supplied password is authorized to view the PDF document.
 boolean isOwnerAuthorized(java.lang.String password)
          Determines whether the supplied owner password is authorized to view the PDF document.
 boolean isUserAuthorized(java.lang.String password)
          Determines whether the supplied user password is authorized to view the PDF document.
 

Method Detail

isAuthorized

boolean isAuthorized(java.lang.String password)
Determines whether the supplied password is authorized to view the PDF document. If a password is rejected, the user should be restricted from viewing the document.

Parameters:
password - password to authorize
Returns:
true, if the password was authorized successfully; false, otherwise.

isUserAuthorized

boolean isUserAuthorized(java.lang.String password)
Determines whether the supplied user password is authorized to view the PDF document. If a password is rejected, the user should be restricted from viewing the document.

Parameters:
password - password to authorize
Returns:
true, if the password was authorized successfully; false, otherwise.

isOwnerAuthorized

boolean isOwnerAuthorized(java.lang.String password)
Determines whether the supplied owner password is authorized to view the PDF document. If a password is rejected, the user should be restricted from viewing the document.

Parameters:
password - password to authorize
Returns:
true, if the password was authorized successfully; false, otherwise.

encrypt

byte[] encrypt(Reference objectReference,
               byte[] encryptionKey,
               byte[] data)
Encrypt the PDF data bytestream or string.

Parameters:
objectReference - reference to PDF object being encrypted; this object contains the PDF object number and revision.
encryptionKey - encryption key used by encryption algorithm.
data - byte data to be encrypted; either represents an object stream or string value.
Returns:
the encrypted stream or string byte data

decrypt

byte[] decrypt(Reference objectReference,
               byte[] encryptionKey,
               byte[] data)
Decrypt the PDF data bytestream or string.

Parameters:
objectReference - reference to PDF object being encrypted; this object contains the PDF object number and revision.
encryptionKey - encryption key used by decryption algorithm.
data - byte data to be decrypted; either represents an object stream or string value.
Returns:
the decrypted stream or string byte data

getEncryptionInputStream

java.io.InputStream getEncryptionInputStream(Reference objectReference,
                                             byte[] encryptionKey,
                                             java.util.HashMap decodeParams,
                                             java.io.InputStream input)

getEncryptionKey

byte[] getEncryptionKey()
Gets the encryption key used by the security handler for encrypting data.

Returns:
byte data representing encryption key

getDecryptionKey

byte[] getDecryptionKey()
Gets the encryption key used by the security handler for decryption data.

Returns:
byte data representing encryption key

getHandlerName

java.lang.String getHandlerName()
Gets the name of the default security handler.

Returns:
string representing security handler name

getPermissions

Permissions getPermissions()
Gets the PDF permissions object associated with this document's security handler.

Returns:
security handlers permissions object

init

void init()
Initiate the security handler


dispose

void dispose()
Dispose of the security handler.