Class OutputOptions
Additional document level options
These options are available for all signature operations of the Signer.
They can also be used without a signature operation with the method Signer.process(com.pdftools.pdf.Document, com.pdftools.sys.Stream).
Notes on document encryption when processing files with the Signer:
-
PDF/A conformance is removed from input files.
In this case, a
Signer.WarningListenerwith anWarningCategory.PDF_A_REMOVEDis generated. -
Signed documents cannot be encrypted or decrypted.
In this case, a
Signer.WarningListenerwith anWarningCategory.SIGNED_DOC_ENCRYPTION_UNCHANGEDis generated.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdd validation information to existing signatures of input document (Getter)Whether to remove any signatures (Getter)voidAdd validation information to existing signatures of input document (Setter)voidWhether to remove any signatures (Setter)Methods inherited from class com.pdftools.pdf.OutputOptions
getEncryption, getMetadataSettings, setEncryption, setMetadataSettingsMethods inherited from class com.pdftools.internal.NativeObject
equals, hashCode
-
Constructor Details
-
OutputOptions
public OutputOptions()
-
-
Method Details
-
getRemoveSignatures
Whether to remove any signatures (Getter)
By default, all signatures of the input document are preserved. Optionally, some or all of them can be removed.
Default:
SignatureRemoval.NONE -
setRemoveSignatures
Whether to remove any signatures (Setter)
By default, all signatures of the input document are preserved. Optionally, some or all of them can be removed.
Default:
SignatureRemoval.NONE- Throws:
IllegalArgumentException- ifvalueisnull
-
getAddValidationInformation
Add validation information to existing signatures of input document (Getter)
Add signature validation information to the document security store (DSS). This information includes:
- All certificates of the signing certificate’s trust chain, unless they are already embedded into the signature.
- Revocation data (OCSP or CRL) for all certificates that support revocation information.
pdftools.crypto.ValidationInformation.Validation information for embedded time-stamp tokens is added as well.
If adding validation information fails, an
Signer.WarningListenerwith anWarningCategory.ADD_VALIDATION_INFORMATION_FAILEDis generated.All types of cryptographic providers support this method. However, this method fails when using a provider whose certificate store is missing a required certificate.
Note: This property has no effect on any new signatures or time-stamp that may also be added. The validation information of signatures and time-stamps is controlled by the respective property in the signature or time-stamp configuration object.
Note: This method does not validate the signatures, but only downloads the information required.
Note: Adding validation information for expired certificates is not possible. Therefore, it is crucial to enlarge the longevity of signatures before they expire.
Note: Adding validation information to document certification (MDP) signatures is not possible, because it would break the signature. Validation information must be added to certification signatures when creating them.
Default:
AddValidationInformation.NONE -
setAddValidationInformation
Add validation information to existing signatures of input document (Setter)
Add signature validation information to the document security store (DSS). This information includes:
- All certificates of the signing certificate’s trust chain, unless they are already embedded into the signature.
- Revocation data (OCSP or CRL) for all certificates that support revocation information.
pdftools.crypto.ValidationInformation.Validation information for embedded time-stamp tokens is added as well.
If adding validation information fails, an
Signer.WarningListenerwith anWarningCategory.ADD_VALIDATION_INFORMATION_FAILEDis generated.All types of cryptographic providers support this method. However, this method fails when using a provider whose certificate store is missing a required certificate.
Note: This property has no effect on any new signatures or time-stamp that may also be added. The validation information of signatures and time-stamps is controlled by the respective property in the signature or time-stamp configuration object.
Note: This method does not validate the signatures, but only downloads the information required.
Note: Adding validation information for expired certificates is not possible. Therefore, it is crucial to enlarge the longevity of signatures before they expire.
Note: Adding validation information to document certification (MDP) signatures is not possible, because it would break the signature. Validation information must be added to certification signatures when creating them.
Default:
AddValidationInformation.NONE- Throws:
IllegalArgumentException- ifvalueisnull
-