com.crionics.jpdf
Class PdfDocumentSecurity

java.lang.Object
  extended by PdfModule
      extended by com.crionics.jpdf.AbstractModule
          extended by com.crionics.jpdf.PdfDocumentSecurity

public class PdfDocumentSecurity
extends AbstractModule

Contains all the methods related to document security


Field Summary
 
Fields inherited from class com.crionics.jpdf.AbstractModule
MOD_CREATOR, MOD_DESCRIPTION, MOD_ENCRYPTION, MOD_MERGER, MOD_PRINTER, MOD_SECURITY, MOD_SIGNER, MOD_TEMPLATE
 
Method Summary
 int getEncryptionKeyLength()
          Returns the key length used by the encryption.
 int getEncryptionType()
          Returns the encryption type used to cipher the document
 Permissions getPermissions()
          Returns the access permissions associated with the document.
 int getSecurityType()
          Returns the security type used to authenticate credentials
 boolean isCiphered()
          Returns the current encryption state of the document.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getEncryptionKeyLength

public int getEncryptionKeyLength()
                           throws PdfException,
                                  java.io.IOException
Returns the key length used by the encryption.
Typically, RC4 is either 40 or 128 bits ; AES is 128 bits

Returns:
the key length used by the encryption, 0 if document is not ciphered
Throws:
PdfException
java.io.IOException

getEncryptionType

public int getEncryptionType()
                      throws PdfException,
                             java.io.IOException
Returns the encryption type used to cipher the document

Returns:
Preferences.ENCRYPTION_NONE,
Preferences.ENCRYPTION_RC4
or Preferences.ENCRYPTION_AES
Throws:
PdfException
java.io.IOException

getPermissions

public Permissions getPermissions()
                           throws PdfException,
                                  java.io.IOException
Returns the access permissions associated with the document.

Returns:
The document permissions (Permissions).
Throws:
PdfException - Raised if a problem occured while parsing the file.
java.io.IOException - Raised if a problem occured while reading the file.

getSecurityType

public int getSecurityType()
                    throws PdfException,
                           java.io.IOException
Returns the security type used to authenticate credentials

Returns:
Preferences.SECURITY_NONE,
Preferences.SECURITY_PASSWORD_PROTECTED
or Preferences.SECURITY_CERTIFICATE_PROTECTED
Throws:
PdfException
java.io.IOException

isCiphered

public boolean isCiphered()
                   throws PdfException
Returns the current encryption state of the document.

Returns:
true if document is ciphered, false otherwise.
Throws:
PdfException


Copyright © 1999-2007 Crionics. All Rights Reserved.