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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Map
getEncryptParameters()
Get the encryption parameters map used for encryption.SecurityManager
getSecurityManager()
Return the Security Manager that contains Security Handlers used to encrypt a PDF document.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.boolean
shouldEncrypt()
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
SecurityManager
object. 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
Map
uses 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:
true
if this document should be encrypted;false
, otherwise.
-
getEncryptParameters
java.util.Map getEncryptParameters()
Get the encryption parameters map used for encryption.This
Map
uses the same correspondence between PDF Types and Java Objects as in thesetEncryptParameters(Map)
method.- Returns:
- a
Map
that contains encryption parameters. May returnnull
.
-
-