java.lang.Object | |
↳ | com.pspdfkit.signatures.signers.Signer |
![]() |
![]() |
Represents a signer (person and algorithm) used to digitally sign a document. Implementations of this class are, for example, MemorySigner
and Pkcs12Signer
. Subclasses need to implement prepareSigningParameters(OnSigningParametersReadyCallback)
which will be called by the signer whenever a digital signing operation is initiated.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
interface | Signer.OnSigningParametersReadyCallback | Callback passed to prepareSigningParameters(OnSigningParametersReadyCallback) whenever a signing process was initiated and
the signer needs to load its SignatureProvider . |
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Signer(String displayName)
Create the
Signer with a digital signature subfilter type set as ADOBE_PKCS7_DETACHED . | |||||||||||
Signer(String displayName, FilterSubtype filterSubtype)
Create the
Signer with a specific digital signature subfilter type. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
final Completable |
embedSignatureInFormFieldAsync(SignatureFormField formField, SignatureContents contents, OutputStream destination)
Embeds signature contents in a signature form field.
| ||||||||||
final String |
getDisplayName()
Gets the display name of this signer for use in the UI.
| ||||||||||
final FilterSubtype |
getFilterSubtype()
Gets the Signature "SubFilter" type in the PDF.
| ||||||||||
final Completable |
prepareFormFieldForSigningAsync(SignerOptions signerOptions)
Builds a document where form field is prepared with a custom appearance and filled with
SignatureContents . | ||||||||||
final void |
signFormField(SignerOptions signerOptions)
Signs a
SignatureFormField form element (and with that, the document). | ||||||||||
Completable |
signFormFieldAsync(SignerOptions signerOptions)
Signs a
SignatureFormField form element (and with that, the document) asynchronously on a background thread. |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
prepareSigningParameters(Signer.OnSigningParametersReadyCallback callback)
Called by
Signer whenever the implementation should prepare required signing parameters. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Create the Signer
with a digital signature subfilter type set as ADOBE_PKCS7_DETACHED
.
displayName | The human readable name of this signer. |
---|
Create the Signer
with a specific digital signature subfilter type.
displayName | The human readable name of this signer. |
---|---|
filterSubtype | Signature "SubFilter" type in the PDF. |
Embeds signature contents in a signature form field. It assumes that the document that contains signatureFormField
has been
prepared for digital signing by calling prepareFormFieldForSigningAsync(SignerOptions)
before.
Note that this API does not allow any more arguments (as defined in SignerOptions
,
because if we want the signature to remain valid we can’t touch the document any more than changing the signature contents set via
prepareFormFieldForSigningAsync(SignerOptions)
with signature contents. No appearance, no biometric properties, etc.
formField | The signature form field to sign. |
---|---|
contents | Signature contents that will be embedded in the document. |
destination | The destination to output the signed document. |
Gets the display name of this signer for use in the UI. This is usually the name of the person that is signing the document.
Gets the Signature "SubFilter" type in the PDF. If not specified in the constructor it defaults to ADOBE_PKCS7_DETACHED
, as it's the only value fully supported for now. Other values are ADOBE_PKCS7_SHA1
(deprecated), and ETSI_CADES_DETACHED
for advanced digital signatures which are
only partially supported for now.
Builds a document where form field is prepared with a custom appearance and filled with SignatureContents
.
Typically, you will want to pass an instance of a BlankSignatureContents
as
signature contents to simply fill the signature contents with zeros.
Note that the document generated by this method has two important properties:
signerOptions | Signer options to use, expects signatureContents to be set. |
---|
Signs a SignatureFormField
form element (and with that, the document).
NOTE: Signing a document requires reading it in full and will take a lot of time.
Do not attempt to invoke that on main thread. Prefer to use signFormFieldAsync(SignerOptions)
if possible.
signerOptions | The SignerOptions to use for signing this document.
|
---|
Signs a SignatureFormField
form element (and with that, the document) asynchronously on a background thread.
signerOptions | The SignerOptions to use for signing this document. |
---|
Completable
that can be subscribed to.
Called by Signer
whenever the implementation should prepare required signing parameters. This is an asynchronous operation,
which is completed by the implementation handing over the signing parameters using the given Signer.OnSigningParametersReadyCallback
. Signing parameters include:
SignatureProvider
that implements the actual data signing logic (i.e. signing
and hashing PDF data).
X509Certificate
that is embedded to the PDF document while signing.
callback | An Signer.OnSigningParametersReadyCallback that should be called by the implementation to hand over all required
signing parameters.
|
---|