public class Signer extends NativeObject
Modifier and Type | Class | Description |
---|---|---|
class |
Signer.Warning |
Event for non-critical errors occurring during signature processing
|
static interface |
Signer.WarningListener |
Listener interface for the
Signer.Warning event. |
Constructor | Description |
---|---|
Signer() |
Modifier and Type | Method | Description |
---|---|---|
PreparedDocument |
addPreparedSignature(Document document,
SignatureConfiguration configuration,
Stream stream) |
Add a prepared signature
|
PreparedDocument |
addPreparedSignature(Document document,
SignatureConfiguration configuration,
Stream stream,
OutputOptions outputOptions) |
Add a prepared signature
|
Document |
addSignatureField(Document document,
SignatureFieldOptions options,
Stream stream) |
Add an unsigned signature field
|
Document |
addSignatureField(Document document,
SignatureFieldOptions options,
Stream stream,
OutputOptions outputOptions) |
Add an unsigned signature field
|
Document |
addTimestamp(Document document,
TimestampConfiguration configuration,
Stream stream) |
Add a document time-stamp
|
Document |
addTimestamp(Document document,
TimestampConfiguration configuration,
Stream stream,
OutputOptions outputOptions) |
Add a document time-stamp
|
void |
addWarningListener(Signer.WarningListener listener) |
Add a listener for the
Signer.Warning event. |
Document |
certify(Document document,
SignatureConfiguration configuration,
Stream stream) |
Add a document certification signature
|
Document |
certify(Document document,
SignatureConfiguration configuration,
Stream stream,
MdpPermissionOptions permissions) |
Add a document certification signature
|
Document |
certify(Document document,
SignatureConfiguration configuration,
Stream stream,
MdpPermissionOptions permissions,
OutputOptions outputOptions) |
Add a document certification signature
|
Document |
process(Document document,
Stream stream) |
Process a document
|
Document |
process(Document document,
Stream stream,
OutputOptions outputOptions) |
Process a document
|
Document |
process(Document document,
Stream stream,
OutputOptions outputOptions,
Provider provider) |
Process a document
|
void |
removeWarningListener(Signer.WarningListener listener) |
Remove registered listener for the
Signer.Warning event. |
Document |
sign(Document document,
SignatureConfiguration configuration,
Stream stream) |
Add a document signature
|
Document |
sign(Document document,
SignatureConfiguration configuration,
Stream stream,
OutputOptions outputOptions) |
Add a document signature
|
Document |
signPreparedSignature(Document document,
SignatureConfiguration configuration,
Stream stream) |
Sign a prepared signature
|
equals, hashCode
public void addWarningListener(Signer.WarningListener listener)
Signer.Warning
event.listener
- Listener for the Signer.Warning
event.
If a listener is added that is already registered, it is ignored.public void removeWarningListener(Signer.WarningListener listener)
Signer.Warning
event.listener
- Listener for the Signer.Warning
event that should be removed.
If the listener is not registered, it is ignored.public Document sign(Document document, SignatureConfiguration configuration, Stream stream) throws java.io.IOException, NotFoundException, LicenseException, UnsupportedFeatureException, PermissionException, HttpException, RetryException
Document signatures are sometimes also called approval signatures. This type of signature lets you verify the integrity of the signed part of the document and authenticate the signer’s identity.
The features and format of the signature are defined by the pdftools.crypto.providers.Provider
and the configuration
.
Non-critical processing errors raise a Signer.WarningListener
.
It is recommended to review the WarningCategory
and handle them if necessary for the application.
document
- The input document to signconfiguration
- The signature configurationstream
- The stream where the signed document is written toLicenseException
- The license check has failed.java.io.IOException
- Writing to the stream
failed.UnsupportedFeatureException
- The input PDF contains unrendered XFA form fields.
See pdftools.pdf.Document.getXfa
for more information on how to detect and handle XFA documents.java.lang.IllegalArgumentException
- If the configuration
is invalid, e.g. because the creating provider has been closed.java.lang.IllegalArgumentException
- If the configuration
is invalid, e.g. because it has been revoked.NotFoundException
- If the SignatureConfiguration.getFieldName()
does not exist in document
.RetryException
- If an unexpected error occurs that can be resolved by retrying the operation.
For example, if a signature service returns an unexpectedly large signature.RetryException
- If a resource required by the cryptographic provider is temporarily unavailable.HttpException
- If a network error occurs, e.g. downloading revocation information (OCSP, CRL) or a time-stamp.UnsupportedFeatureException
- If the cryptographic provider does not support the requested signing algorithm.PermissionException
- If the cryptographic provider does not allow the signing operation.java.lang.IllegalArgumentException
- if document
is null
java.lang.IllegalArgumentException
- if configuration
is null
java.lang.IllegalArgumentException
- if stream
is null
public Document sign(Document document, SignatureConfiguration configuration, Stream stream, OutputOptions outputOptions) throws java.io.IOException, NotFoundException, LicenseException, UnsupportedFeatureException, PermissionException, HttpException, RetryException
Document signatures are sometimes also called approval signatures. This type of signature lets you verify the integrity of the signed part of the document and authenticate the signer’s identity.
The features and format of the signature are defined by the pdftools.crypto.providers.Provider
and the configuration
.
Non-critical processing errors raise a Signer.WarningListener
.
It is recommended to review the WarningCategory
and handle them if necessary for the application.
document
- The input document to signconfiguration
- The signature configurationstream
- The stream where the signed document is written tooutputOptions
- Document-level output options not directly related to the signatureLicenseException
- The license check has failed.java.io.IOException
- Writing to the stream
failed.UnsupportedFeatureException
- The input PDF contains unrendered XFA form fields.
See pdftools.pdf.Document.getXfa
for more information on how to detect and handle XFA documents.java.lang.IllegalArgumentException
- If the configuration
is invalid, e.g. because the creating provider has been closed.java.lang.IllegalArgumentException
- If the configuration
is invalid, e.g. because it has been revoked.NotFoundException
- If the SignatureConfiguration.getFieldName()
does not exist in document
.RetryException
- If an unexpected error occurs that can be resolved by retrying the operation.
For example, if a signature service returns an unexpectedly large signature.RetryException
- If a resource required by the cryptographic provider is temporarily unavailable.HttpException
- If a network error occurs, e.g. downloading revocation information (OCSP, CRL) or a time-stamp.UnsupportedFeatureException
- If the cryptographic provider does not support the requested signing algorithm.PermissionException
- If the cryptographic provider does not allow the signing operation.java.lang.IllegalArgumentException
- if document
is null
java.lang.IllegalArgumentException
- if configuration
is null
java.lang.IllegalArgumentException
- if stream
is null
public Document certify(Document document, SignatureConfiguration configuration, Stream stream) throws java.io.IOException, NotFoundException, LicenseException, UnsupportedFeatureException, PermissionException, HttpException, RetryException
This type of signature lets you detect rejected changes specified by the author.
These signatures are also called Modification Detection and Prevention (MDP) signatures.
The allowed permissions are defined by permissions
.
The features and format of the signature are defined by the pdftools.crypto.providers.Provider
and the
configuration
.
Non-critical processing errors raise a Signer.WarningListener
.
It is recommended to review the WarningCategory
and handle them if necessary for the application.
document
- The input document to certifyconfiguration
- The signature configurationstream
- The stream where the certified document is written toLicenseException
- The license check has failed.java.io.IOException
- Writing to the stream
failed.UnsupportedFeatureException
- The input PDF contains unrendered XFA form fields.
See pdftools.pdf.Document.getXfa
for more information on how to detect and handle XFA documents.java.lang.IllegalArgumentException
- If the configuration
is invalid, e.g. because the creating provider has been closed.NotFoundException
- If the SignatureConfiguration.getFieldName()
does not exist in document
.RetryException
- If an unexpected error occurs that can be resolved by retrying the operation.
For example, if a signature service returns an unexpectedly large signature.RetryException
- If a resource required by the cryptographic provider is temporarily unavailable.HttpException
- If a network error occurs, e.g. downloading revocation information (OCSP, CRL) or a time-stamp.UnsupportedFeatureException
- If the cryptographic provider does not support the requested signing algorithm.PermissionException
- If the cryptographic provider does not allow the signing operation.java.lang.IllegalArgumentException
- if document
is null
java.lang.IllegalArgumentException
- if configuration
is null
java.lang.IllegalArgumentException
- if stream
is null
public Document certify(Document document, SignatureConfiguration configuration, Stream stream, MdpPermissionOptions permissions) throws java.io.IOException, NotFoundException, LicenseException, UnsupportedFeatureException, PermissionException, HttpException, RetryException
This type of signature lets you detect rejected changes specified by the author.
These signatures are also called Modification Detection and Prevention (MDP) signatures.
The allowed permissions are defined by permissions
.
The features and format of the signature are defined by the pdftools.crypto.providers.Provider
and the
configuration
.
Non-critical processing errors raise a Signer.WarningListener
.
It is recommended to review the WarningCategory
and handle them if necessary for the application.
document
- The input document to certifyconfiguration
- The signature configurationstream
- The stream where the certified document is written topermissions
- The permissions allowed. The default is pdftools.pdf.MdpPermissions.NO_CHANGES
.LicenseException
- The license check has failed.java.io.IOException
- Writing to the stream
failed.UnsupportedFeatureException
- The input PDF contains unrendered XFA form fields.
See pdftools.pdf.Document.getXfa
for more information on how to detect and handle XFA documents.java.lang.IllegalArgumentException
- If the configuration
is invalid, e.g. because the creating provider has been closed.NotFoundException
- If the SignatureConfiguration.getFieldName()
does not exist in document
.RetryException
- If an unexpected error occurs that can be resolved by retrying the operation.
For example, if a signature service returns an unexpectedly large signature.RetryException
- If a resource required by the cryptographic provider is temporarily unavailable.HttpException
- If a network error occurs, e.g. downloading revocation information (OCSP, CRL) or a time-stamp.UnsupportedFeatureException
- If the cryptographic provider does not support the requested signing algorithm.PermissionException
- If the cryptographic provider does not allow the signing operation.java.lang.IllegalArgumentException
- if document
is null
java.lang.IllegalArgumentException
- if configuration
is null
java.lang.IllegalArgumentException
- if stream
is null
public Document certify(Document document, SignatureConfiguration configuration, Stream stream, MdpPermissionOptions permissions, OutputOptions outputOptions) throws java.io.IOException, NotFoundException, LicenseException, UnsupportedFeatureException, PermissionException, HttpException, RetryException
This type of signature lets you detect rejected changes specified by the author.
These signatures are also called Modification Detection and Prevention (MDP) signatures.
The allowed permissions are defined by permissions
.
The features and format of the signature are defined by the pdftools.crypto.providers.Provider
and the
configuration
.
Non-critical processing errors raise a Signer.WarningListener
.
It is recommended to review the WarningCategory
and handle them if necessary for the application.
document
- The input document to certifyconfiguration
- The signature configurationstream
- The stream where the certified document is written topermissions
- The permissions allowed. The default is pdftools.pdf.MdpPermissions.NO_CHANGES
.outputOptions
- Document-level output options not directly related to the document certificationLicenseException
- The license check has failed.java.io.IOException
- Writing to the stream
failed.UnsupportedFeatureException
- The input PDF contains unrendered XFA form fields.
See pdftools.pdf.Document.getXfa
for more information on how to detect and handle XFA documents.java.lang.IllegalArgumentException
- If the configuration
is invalid, e.g. because the creating provider has been closed.NotFoundException
- If the SignatureConfiguration.getFieldName()
does not exist in document
.RetryException
- If an unexpected error occurs that can be resolved by retrying the operation.
For example, if a signature service returns an unexpectedly large signature.RetryException
- If a resource required by the cryptographic provider is temporarily unavailable.HttpException
- If a network error occurs, e.g. downloading revocation information (OCSP, CRL) or a time-stamp.UnsupportedFeatureException
- If the cryptographic provider does not support the requested signing algorithm.PermissionException
- If the cryptographic provider does not allow the signing operation.java.lang.IllegalArgumentException
- if document
is null
java.lang.IllegalArgumentException
- if configuration
is null
java.lang.IllegalArgumentException
- if stream
is null
public Document addTimestamp(Document document, TimestampConfiguration configuration, Stream stream) throws java.io.IOException, NotFoundException, LicenseException, UnsupportedFeatureException, PermissionException, HttpException, RetryException
This type of signature provides evidence that the document existed at a specific time and protects the document’s integrity.
The features and format of the signature are defined by the pdftools.crypto.providers.Provider
and the
configuration
.
Non-critical processing errors raise a Signer.WarningListener
.
It is recommended to review the WarningCategory
and handle them if necessary for the application.
document
- The input document to add a time-stamp toconfiguration
- The time-stamp configurationstream
- The stream where the output document is written toLicenseException
- The license check has failed.java.io.IOException
- Writing to the stream
failed.UnsupportedFeatureException
- The input PDF contains unrendered XFA form fields.
See pdftools.pdf.Document.getXfa
for more information on how to detect and handle XFA documents.java.lang.IllegalArgumentException
- If the configuration
is invalid, e.g. because the creating provider has been closed.NotFoundException
- If the SignatureConfiguration.getFieldName()
does not exist in document
.RetryException
- If an unexpected error occurs that can be resolved by retrying the operation.
For example, if a signature service returns an unexpectedly large signature.RetryException
- If a resource required by the cryptographic provider is temporarily unavailable.HttpException
- If a network error occurs, e.g. downloading revocation information (OCSP, CRL) or a time-stamp.UnsupportedFeatureException
- If the cryptographic provider does not support the requested signing algorithm.PermissionException
- If the cryptographic provider does not allow the signing operation.java.lang.IllegalArgumentException
- if document
is null
java.lang.IllegalArgumentException
- if configuration
is null
java.lang.IllegalArgumentException
- if stream
is null
public Document addTimestamp(Document document, TimestampConfiguration configuration, Stream stream, OutputOptions outputOptions) throws java.io.IOException, NotFoundException, LicenseException, UnsupportedFeatureException, PermissionException, HttpException, RetryException
This type of signature provides evidence that the document existed at a specific time and protects the document’s integrity.
The features and format of the signature are defined by the pdftools.crypto.providers.Provider
and the
configuration
.
Non-critical processing errors raise a Signer.WarningListener
.
It is recommended to review the WarningCategory
and handle them if necessary for the application.
document
- The input document to add a time-stamp toconfiguration
- The time-stamp configurationstream
- The stream where the output document is written tooutputOptions
- Document-level output options not directly related to the document time-stampLicenseException
- The license check has failed.java.io.IOException
- Writing to the stream
failed.UnsupportedFeatureException
- The input PDF contains unrendered XFA form fields.
See pdftools.pdf.Document.getXfa
for more information on how to detect and handle XFA documents.java.lang.IllegalArgumentException
- If the configuration
is invalid, e.g. because the creating provider has been closed.NotFoundException
- If the SignatureConfiguration.getFieldName()
does not exist in document
.RetryException
- If an unexpected error occurs that can be resolved by retrying the operation.
For example, if a signature service returns an unexpectedly large signature.RetryException
- If a resource required by the cryptographic provider is temporarily unavailable.HttpException
- If a network error occurs, e.g. downloading revocation information (OCSP, CRL) or a time-stamp.UnsupportedFeatureException
- If the cryptographic provider does not support the requested signing algorithm.PermissionException
- If the cryptographic provider does not allow the signing operation.java.lang.IllegalArgumentException
- if document
is null
java.lang.IllegalArgumentException
- if configuration
is null
java.lang.IllegalArgumentException
- if stream
is null
public Document addSignatureField(Document document, SignatureFieldOptions options, Stream stream) throws java.io.IOException, LicenseException, UnsupportedFeatureException, ExistsException
Add an unsigned signature field that can later be signed (see pdftools.pdf.UnsignedSignatureField
).
Non-critical processing errors raise a Signer.WarningListener
.
It is recommended to review the WarningCategory
and handle them if necessary for the application.
document
- The input document to add the signature field tooptions
- The options for the unsigned signature fieldstream
- The stream where the output document is written toLicenseException
- The license check has failed.java.io.IOException
- Writing to the stream
failed.UnsupportedFeatureException
- The input PDF contains unrendered XFA form fields.
See pdftools.pdf.Document.getXfa
for more information on how to detect and handle XFA documents.ExistsException
- The SignatureFieldOptions.getFieldName()
exists already in the input document.java.lang.IllegalArgumentException
- if document
is null
java.lang.IllegalArgumentException
- if options
is null
java.lang.IllegalArgumentException
- if stream
is null
public Document addSignatureField(Document document, SignatureFieldOptions options, Stream stream, OutputOptions outputOptions) throws java.io.IOException, LicenseException, UnsupportedFeatureException, ExistsException
Add an unsigned signature field that can later be signed (see pdftools.pdf.UnsignedSignatureField
).
Non-critical processing errors raise a Signer.WarningListener
.
It is recommended to review the WarningCategory
and handle them if necessary for the application.
document
- The input document to add the signature field tooptions
- The options for the unsigned signature fieldstream
- The stream where the output document is written tooutputOptions
- Document-level output options not directly related to the signature fieldLicenseException
- The license check has failed.java.io.IOException
- Writing to the stream
failed.UnsupportedFeatureException
- The input PDF contains unrendered XFA form fields.
See pdftools.pdf.Document.getXfa
for more information on how to detect and handle XFA documents.ExistsException
- The SignatureFieldOptions.getFieldName()
exists already in the input document.java.lang.IllegalArgumentException
- if document
is null
java.lang.IllegalArgumentException
- if options
is null
java.lang.IllegalArgumentException
- if stream
is null
public PreparedDocument addPreparedSignature(Document document, SignatureConfiguration configuration, Stream stream) throws java.io.IOException, NotFoundException, LicenseException, UnsupportedFeatureException, HttpException
Adding a prepared signature is only required in very particular or specialized use cases.
This method is the same as sign(com.pdftools.pdf.Document, com.pdftools.sign.SignatureConfiguration, com.pdftools.sys.Stream)
, but without actually creating the cryptographic signature.
The cryptographic signature can be inserted later using signPreparedSignature(com.pdftools.pdf.Document, com.pdftools.sign.SignatureConfiguration, com.pdftools.sys.Stream)
.
While the configuration
can be created by any pdftools.crypto.providers.Provider
,
it is typically created by pdftools.crypto.providers.builtin.Provider.createPreparedSignature
.
document
- The input document to add the prepared signatureconfiguration
- The signature configurationstream
- The stream where the output document is written toLicenseException
- The license check has failed.java.io.IOException
- Writing to the stream
failed.UnsupportedFeatureException
- The input PDF contains unrendered XFA form fields.
See pdftools.pdf.Document.getXfa
for more information on how to detect and handle XFA documents.java.lang.IllegalArgumentException
- If the configuration
is invalid, e.g. because the creating provider has been closedNotFoundException
- If the SignatureConfiguration.getFieldName()
does not exist in document
.UnsupportedFeatureException
- If the cryptographic provider does not support the requested signing algorithm.HttpException
- If a network error occurs, e.g. downloading revocation information (OCSP, CRL).java.lang.IllegalArgumentException
- if document
is null
java.lang.IllegalArgumentException
- if configuration
is null
java.lang.IllegalArgumentException
- if stream
is null
public PreparedDocument addPreparedSignature(Document document, SignatureConfiguration configuration, Stream stream, OutputOptions outputOptions) throws java.io.IOException, NotFoundException, LicenseException, UnsupportedFeatureException, HttpException
Adding a prepared signature is only required in very particular or specialized use cases.
This method is the same as sign(com.pdftools.pdf.Document, com.pdftools.sign.SignatureConfiguration, com.pdftools.sys.Stream)
, but without actually creating the cryptographic signature.
The cryptographic signature can be inserted later using signPreparedSignature(com.pdftools.pdf.Document, com.pdftools.sign.SignatureConfiguration, com.pdftools.sys.Stream)
.
While the configuration
can be created by any pdftools.crypto.providers.Provider
,
it is typically created by pdftools.crypto.providers.builtin.Provider.createPreparedSignature
.
document
- The input document to add the prepared signatureconfiguration
- The signature configurationstream
- The stream where the output document is written tooutputOptions
- Document-level output options not directly related to preparing the signatureLicenseException
- The license check has failed.java.io.IOException
- Writing to the stream
failed.UnsupportedFeatureException
- The input PDF contains unrendered XFA form fields.
See pdftools.pdf.Document.getXfa
for more information on how to detect and handle XFA documents.java.lang.IllegalArgumentException
- If the configuration
is invalid, e.g. because the creating provider has been closedNotFoundException
- If the SignatureConfiguration.getFieldName()
does not exist in document
.UnsupportedFeatureException
- If the cryptographic provider does not support the requested signing algorithm.HttpException
- If a network error occurs, e.g. downloading revocation information (OCSP, CRL).java.lang.IllegalArgumentException
- if document
is null
java.lang.IllegalArgumentException
- if configuration
is null
java.lang.IllegalArgumentException
- if stream
is null
public Document signPreparedSignature(Document document, SignatureConfiguration configuration, Stream stream) throws java.io.IOException, LicenseException, UnsupportedFeatureException, PermissionException, HttpException, RetryException
addPreparedSignature(com.pdftools.pdf.Document, com.pdftools.sign.SignatureConfiguration, com.pdftools.sys.Stream)
.
Note that the configuration
must be compatible to the configuration used when preparing the signature.document
- The input document to signconfiguration
- The signature configurationstream
- The stream where the signed document is written toLicenseException
- The license check has failed.java.io.IOException
- Writing to the stream
failed.java.lang.IllegalArgumentException
- If the document
does not contain a prepared signature created by addPreparedSignature(com.pdftools.pdf.Document, com.pdftools.sign.SignatureConfiguration, com.pdftools.sys.Stream)
java.lang.IllegalArgumentException
- If the configuration
is invalid, e.g. because the creating provider has been closed.RetryException
- If an unexpected error occurs that can be resolved by retrying the operation.
For example, if a signature service returns an unexpectedly large signature.RetryException
- If a resource required by the cryptographic provider is temporarily unavailable.HttpException
- If a network error occurs, e.g. downloading revocation information (OCSP, CRL) or a time-stamp.UnsupportedFeatureException
- If the cryptographic provider does not support the requested signing algorithm.PermissionException
- If the cryptographic provider does not allow the signing operation.java.lang.IllegalArgumentException
- if document
is null
java.lang.IllegalArgumentException
- if configuration
is null
java.lang.IllegalArgumentException
- if stream
is null
public Document process(Document document, Stream stream) throws java.io.IOException, LicenseException, UnsupportedFeatureException, HttpException
Apply document-level processing options without any signature operation. For example:
OutputOptions.getRemoveSignatures()
).
OutputOptions.getAddValidationInformation()
).
Non-critical processing errors raise a Signer.WarningListener
.
It is recommended to review the WarningCategory
and handle them if necessary for the application.
document
- The input document to processstream
- The stream where the output document is written toLicenseException
- The license check has failed.java.io.IOException
- Writing to the stream
failed.UnsupportedFeatureException
- The input PDF contains unrendered XFA form fields.
See pdftools.pdf.Document.getXfa
for more information on how to detect and handle XFA documents.HttpException
- If a network error occurs, e.g. downloading revocation information (OCSP, CRL).java.lang.IllegalArgumentException
- if document
is null
java.lang.IllegalArgumentException
- if stream
is null
public Document process(Document document, Stream stream, OutputOptions outputOptions) throws java.io.IOException, LicenseException, UnsupportedFeatureException, HttpException
Apply document-level processing options without any signature operation. For example:
OutputOptions.getRemoveSignatures()
).
OutputOptions.getAddValidationInformation()
).
Non-critical processing errors raise a Signer.WarningListener
.
It is recommended to review the WarningCategory
and handle them if necessary for the application.
document
- The input document to processstream
- The stream where the output document is written tooutputOptions
- The document-level processing optionsLicenseException
- The license check has failed.java.io.IOException
- Writing to the stream
failed.UnsupportedFeatureException
- The input PDF contains unrendered XFA form fields.
See pdftools.pdf.Document.getXfa
for more information on how to detect and handle XFA documents.HttpException
- If a network error occurs, e.g. downloading revocation information (OCSP, CRL).java.lang.IllegalArgumentException
- if document
is null
java.lang.IllegalArgumentException
- if stream
is null
public Document process(Document document, Stream stream, OutputOptions outputOptions, Provider provider) throws java.io.IOException, LicenseException, UnsupportedFeatureException, HttpException
Apply document-level processing options without any signature operation. For example:
OutputOptions.getRemoveSignatures()
).
OutputOptions.getAddValidationInformation()
).
Non-critical processing errors raise a Signer.WarningListener
.
It is recommended to review the WarningCategory
and handle them if necessary for the application.
document
- The input document to processstream
- The stream where the output document is written tooutputOptions
- The document-level processing optionsprovider
- The cryptographic provider to use to add validation information to existing signatures of input document
(see OutputOptions.getAddValidationInformation()
).
Can be null
if no validation information is added or to use the default provider.LicenseException
- The license check has failed.java.io.IOException
- Writing to the stream
failed.UnsupportedFeatureException
- The input PDF contains unrendered XFA form fields.
See pdftools.pdf.Document.getXfa
for more information on how to detect and handle XFA documents.HttpException
- If a network error occurs, e.g. downloading revocation information (OCSP, CRL).java.lang.IllegalArgumentException
- if document
is null
java.lang.IllegalArgumentException
- if stream
is null