Interface SecurityLock
- All Known Subinterfaces:
SecurityLockPasswordInterface,SecurityLockPKIInterface
public interface SecurityLock
Provides the functionality to (optionally) encrypt a PDFDocument at full save time.
SecurityLock is composed of three attributes:
- Security Manager for encryption
- Encryption Parameters Map
- Requested permissions
Each of these attributes is represented by an object of an appropriate type. Different implementations of the SecurityLock instantiate these attributes according to the rules of specific implementations.
Use SecurityKey.getSecurityManager()
to decrypt the document.
-
Method Summary
Modifier and TypeMethodDescriptionGet the encryption parameters map used for encryption.Return the Security Manager that contains Security Handlers used to encrypt a PDF document.voidsetEncryptParameters(Map encryptParams) Set the encryption parameter map that reflects the content of the /Encrypt dictionary used to encrypt a PDF document.booleanDetermine whether the saved PDF document should be encrypted.
-
Method Details
-
getSecurityManager
SecurityManager getSecurityManager()Return the Security Manager that contains Security Handlers used to encrypt a PDF document.- Returns:
- a
SecurityManagerobject. May returnnull.
-
setEncryptParameters
Set the encryption parameter map that reflects the content of the /Encrypt dictionary used to encrypt a PDF document.This
Mapuses the following correspondence between PDF Types and Java Objects:CosBoolean Boolean CosNumeric Number CosName String CosString Byte array CosArray ArrayList CosDictionary HashMap - Parameters:
encryptParams- the encryption parameters.
-
shouldEncrypt
boolean shouldEncrypt()Determine whether the saved PDF document should be encrypted. The absence of encryption is one of the encryption choices. This method tells the user of the security lock implementation whether the saved PDF document should be encrypted.- Returns:
trueif this document should be encrypted;false, otherwise.
-
getEncryptParameters
Map getEncryptParameters()Get the encryption parameters map used for encryption.This
Mapuses the same correspondence between PDF Types and Java Objects as in thesetEncryptParameters(Map)method.- Returns:
- a
Mapthat contains encryption parameters. May returnnull.
-