java.lang.Object | ||
↳ | com.pspdfkit.signatures.signers.Signer | |
↳ | com.pspdfkit.signatures.signers.PrivateKeySigner |
![]() |
A Signer
implementation for digitally signing PDFs using a KeyStore.PrivateKeyEntry. Subclasses have to provide the private key whenever loadPrivateKey(String, LoadingFeedbackListener, OnPrivateKeyLoadedCallback)
is called. This
class implements InteractiveSigner
which can be used to retrieve a password from the user
if required while loading the private key.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
interface | PrivateKeySigner.OnPrivateKeyLoadedCallback | Callback for subclasses to provide the private key used for signing. |
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
PrivateKeySigner(String displayName)
Create the signer using the given
displayName . |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
final void |
setLoadingFeedbackListener(InteractiveSigner.LoadingFeedbackListener listener)
Sets a listener for being notified of important events that require user interaction.
| ||||||||||
final void |
unlockPrivateKeyWithPassword(String password)
Can be used to provide a password to the signer, which might be used to unlock a private key
(or similar).
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
abstract void |
loadPrivateKey(String password, InteractiveSigner.LoadingFeedbackListener feedbackListener, PrivateKeySigner.OnPrivateKeyLoadedCallback onPrivateKeyLoadedCallback)
Loads the
KeyStore.PrivateKeyEntry used by this signer. | ||||||||||
final void |
prepareSigningParameters(Signer.OnSigningParametersReadyCallback callback)
Called by
Signer whenever the implementation should prepare required signing parameters. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
Create the signer using the given displayName
.
displayName | Human readable name of this signer. |
---|
Sets a listener for being notified of important events that require user interaction.
listener | A LoadingFeedbackListener for receiving important events. |
---|
Can be used to provide a password to the signer, which might be used to unlock a private key (or similar).
password | A password that should be used by the signer, or null if no password
is required.
|
---|
Loads the KeyStore.PrivateKeyEntry
used by this signer. Subclasses have to override
this and have to make sure to call the provided PrivateKeySigner.OnPrivateKeyLoadedCallback
whenever
private key is ready. The method might be called with a LoadingFeedbackListener which
should be used by the implementation to notify of important events (e.g. password required,
key loading complete, etc.).
password | An optional password that should be used to load the private key. |
---|---|
feedbackListener | A LoadingFeedbackListener to be notified of important loading
events, or null . |
onPrivateKeyLoadedCallback | An PrivateKeySigner.OnPrivateKeyLoadedCallback that should be called
once the private key has been loaded.
|
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 OnSigningParametersReadyCallback that should be called by the implementation to hand over all required signing parameters. |
---|