public final class

Pkcs12Signer

extends PrivateKeySigner
java.lang.Object
   ↳ com.pspdfkit.signatures.signers.Signer
     ↳ com.pspdfkit.signatures.signers.PrivateKeySigner
       ↳ com.pspdfkit.signatures.signers.Pkcs12Signer

Class Overview

A Signer that loads the signing certificate from a PKCS12 file.

Summary

Public Constructors
Pkcs12Signer(String displayName, Uri pkcs12CertificateUri)
Create the PKCS12 signer from a file.
Pkcs12Signer(String displayName, Uri pkcs12CertificateUri, String keyAlias)
Create the PKCS12 signer from a file having a named alias.
Public Methods
void loadPrivateKey(String password, InteractiveSigner.LoadingFeedbackListener feedbackListener, PrivateKeySigner.OnPrivateKeyLoadedCallback onPrivateKeyLoadedCallback)
Loads the KeyStore.PrivateKeyEntry used by this signer.
[Expand]
Inherited Methods
From class com.pspdfkit.signatures.signers.PrivateKeySigner
From class com.pspdfkit.signatures.signers.Signer
From class java.lang.Object
From interface com.pspdfkit.signatures.signers.InteractiveSigner

Public Constructors

public Pkcs12Signer (String displayName, Uri pkcs12CertificateUri)

Create the PKCS12 signer from a file.

Parameters
displayName The display name of this signer that should be shown in the app. May not be null.
pkcs12CertificateUri The Uri pointing to the PKCS12 file containing the signing certificate. May not be null.

public Pkcs12Signer (String displayName, Uri pkcs12CertificateUri, String keyAlias)

Create the PKCS12 signer from a file having a named alias.

Parameters
displayName The display name of this signer that should be shown in the app. May not be null.
pkcs12CertificateUri The Uri pointing to the PKCS12 file containing the signing certificate. May not be null.
keyAlias The alias of the certificate in the PKCS12 file, or null to use the first certificate found.

Public Methods

public void loadPrivateKey (String password, InteractiveSigner.LoadingFeedbackListener feedbackListener, PrivateKeySigner.OnPrivateKeyLoadedCallback onPrivateKeyLoadedCallback)

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.).

Parameters
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 OnPrivateKeyLoadedCallback that should be called once the private key has been loaded.