Class PasswordProtectParams.Builder
- java.lang.Object
-
- com.adobe.pdfservices.operation.pdfjobs.params.protectpdf.PasswordProtectParams.Builder
-
- Enclosing class:
- PasswordProtectParams
public static class PasswordProtectParams.Builder extends Object
Builds aPasswordProtectParams
instance.
-
-
Constructor Summary
Constructors Constructor Description Builder()
Constructs aBuilder
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PasswordProtectParams
build()
Returns a newPasswordProtectParams
instance built from the current state of this builder.PasswordProtectParams.Builder
setContentEncryption(ContentEncryption contentEncryption)
Sets the intended type of content to encrypt in the PDF file.PasswordProtectParams.Builder
setEncryptionAlgorithm(EncryptionAlgorithm encryptionAlgorithm)
Sets the intended encryption algorithm required for encrypting the PDF file.PasswordProtectParams.Builder
setOwnerPassword(String ownerPassword)
Sets the intended owner password required to control access permissions in the encrypted PDF file.PasswordProtectParams.Builder
setPermissions(Permissions permissions)
Sets the intended permissions for the encrypted PDF file.PasswordProtectParams.Builder
setUserPassword(String userPassword)
Sets the intended user password required for opening the encrypted PDF file.
-
-
-
Method Detail
-
setUserPassword
public PasswordProtectParams.Builder setUserPassword(String userPassword)
Sets the intended user password required for opening the encrypted PDF file. Allowed maximum length for the user password is 128 bytes.- Parameters:
userPassword
- the user password; can not be null or empty- Returns:
- this Builder instance to add any additional parameters
-
setOwnerPassword
public PasswordProtectParams.Builder setOwnerPassword(String ownerPassword)
Sets the intended owner password required to control access permissions in the encrypted PDF file. This password can also be used to open/view the encrypted PDF file. Allowed maximum length for the owner password is 128 bytes.- Parameters:
ownerPassword
- the owner password; can not be null or empty- Returns:
- this Builder instance to add any additional parameters
-
setEncryptionAlgorithm
public PasswordProtectParams.Builder setEncryptionAlgorithm(EncryptionAlgorithm encryptionAlgorithm)
Sets the intended encryption algorithm required for encrypting the PDF file. For AES-128 encryption, the password supports LATIN-I characters only. For AES-256 encryption, passwords supports Unicode character set.- Parameters:
encryptionAlgorithm
- the encryption algorithm; can not be null- Returns:
- this Builder instance to add any additional parameters
-
setContentEncryption
public PasswordProtectParams.Builder setContentEncryption(ContentEncryption contentEncryption)
Sets the intended type of content to encrypt in the PDF file.- Parameters:
contentEncryption
- the type of content to encrypt; can not be null- Returns:
- this Builder instance to add any additional parameters
-
setPermissions
public PasswordProtectParams.Builder setPermissions(Permissions permissions)
Sets the intended permissions for the encrypted PDF file. This includes permissions to allow printing, editing and content copying in the PDF document. Permissions can only be used in case the owner password is set.- Parameters:
permissions
- the permissions; can not be null- Returns:
- this Builder instance to add any additional parameters
-
build
public PasswordProtectParams build()
Returns a newPasswordProtectParams
instance built from the current state of this builder.- Returns:
- a new
ProtectPDFParams
instance
-
-