Class SignerOptions.Builder
-
- All Implemented Interfaces:
public final class SignerOptions.Builder
A helper class used for building the SignerOptions.
Creates a new Builder for creating the SignerOptions object to pass to the SigningManager. This allows for a custom DataProvider for the output. For a simpler Uri API, use the other constructor.
-
-
Constructor Summary
Constructors Constructor Description SignerOptions.Builder(SignatureFormField signatureFormField, Uri outputFileUri)
Creates a new Builder for creating the SignerOptions object to pass to the SigningManager. SignerOptions.Builder(SignatureFormField signatureFormField, DataProvider outputDataProvider)
-
Method Summary
Modifier and Type Method Description final SignerOptions.Builder
setType(DigitalSignatureType type)
DigitalSignatureType type can be either BASIC or CADES (default). final SignerOptions.Builder
setSignatureMetadata(DigitalSignatureMetadata digitalSignatureMetadata)
DigitalSignatureMetadata that contains additional metadata to add to the signature. final SignerOptions.Builder
setPrivateKey(KeyStore.PrivateKeyEntry privateKeyEntry)
Optionally setPrivateKey inserts Private key for signing PDF. final SignerOptions.Builder
setPrivateKey(PrivateKey privateKey)
Optionally setPrivateKey inserts Private key for signing PDF. final SignerOptions.Builder
setCertificates(List<X509Certificate> certificates)
Optionally add the certificates in the chain used for signing. final SignerOptions.Builder
setEnableLtv(Boolean enableLtv)
Enable or disable embedding Long-Term-Validation (LTV) in the signature which upgrades signature to PAdES B-LT. final SignerOptions
build()
Build the SignerOptions object from the provided properties. -
-
Constructor Detail
-
SignerOptions.Builder
SignerOptions.Builder(SignatureFormField signatureFormField, Uri outputFileUri)
- Parameters:
signatureFormField
- Signature form field to be signed.outputFileUri
- Destination where the signed document will be written.
-
SignerOptions.Builder
SignerOptions.Builder(SignatureFormField signatureFormField, DataProvider outputDataProvider)
- Parameters:
signatureFormField
- Signature form field to be signed.outputDataProvider
- DataProvider where the signed document will be written.
-
-
Method Detail
-
setType
final SignerOptions.Builder setType(DigitalSignatureType type)
DigitalSignatureType type can be either BASIC or CADES (default).
-
setSignatureMetadata
final SignerOptions.Builder setSignatureMetadata(DigitalSignatureMetadata digitalSignatureMetadata)
DigitalSignatureMetadata that contains additional metadata to add to the signature.
-
setPrivateKey
final SignerOptions.Builder setPrivateKey(KeyStore.PrivateKeyEntry privateKeyEntry)
Optionally setPrivateKey inserts Private key for signing PDF. Use this if you want PSPDFKit to do the document signing. Otherwise you need to overwrite the custom signing lambda in SigningManager.signDocument
-
setPrivateKey
final SignerOptions.Builder setPrivateKey(PrivateKey privateKey)
Optionally setPrivateKey inserts Private key for signing PDF. Use this if you want PSPDFKit to do the document signing. Otherwise you need to overwrite the custom signing lambda in SigningManager.signDocument
-
setCertificates
final SignerOptions.Builder setCertificates(List<X509Certificate> certificates)
Optionally add the certificates in the chain used for signing. If empty, we will get them from the private key set in setPrivateKey
-
setEnableLtv
final SignerOptions.Builder setEnableLtv(Boolean enableLtv)
Enable or disable embedding Long-Term-Validation (LTV) in the signature which upgrades signature to PAdES B-LT. LTV will check each certificate for validity and if successful will keep that information in the document. LTV information can also be added later using com.pspdfkit.document.PdfDocument.addLongTermValidation. Note, enabling LTV may result in an HTTP network call which may result in you needing to enable the use of cleartext traffic in your app.
Default value is true.
-
build
final SignerOptions build()
Build the SignerOptions object from the provided properties.
- Returns:
SignerOptions object with values set in the builder.
-
-
-
-