Interface SecurityLock
-
- All Known Subinterfaces:
SecurityLockPasswordInterface,SecurityLockPKIInterface
public interface SecurityLockProvides the functionality to (optionally) encrypt a PDFDocument at full save time.SecurityLockis 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.MapgetEncryptParameters()Get the encryption parameters map used for encryption.SecurityManagergetSecurityManager()Return the Security Manager that contains Security Handlers used to encrypt a PDF document.voidsetEncryptParameters(java.util.Map encryptParams)Set the encryption parameter map that reflects the content of the /Encrypt dictionary used to encrypt a PDF document.booleanshouldEncrypt()Determine whether the saved PDF document should be encrypted.
-
-
-
Method Detail
-
getSecurityManager
SecurityManager getSecurityManager()
Return the Security Manager that contains Security Handlers used to encrypt a PDF document.- Returns:
- a
SecurityManagerobject. May returnnull.
-
setEncryptParameters
void setEncryptParameters(java.util.Map encryptParams)
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
java.util.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.
-
-