SigningManager

SigningManager provides a public API to digitally sign documents with either PAdES advanced digital signatures or basic CMS signatures (see DigitalSignatureType)

Use TrustedKeyStore to add trusted certificates for signature validation.

Functions

Link copied to clipboard
suspend fun embedPKCS7Signature(context: Context, signerOptions: SignerOptions, signedData: ByteArray): Response<Nothing>

This function is used to embed a complete PKCS@7 signature in the document. Results can be extracted by com.pspdfkit.utils.Response.onSuccessEmpty or com.pspdfkit.utils.Response.onError

Link copied to clipboard
suspend fun embedSignature(context: Context, signerOptions: SignerOptions, signedData: ByteArray, unsignedData: ByteArray, hashAlgorithm: HashAlgorithm): Response<Nothing>

This function is used to embed a PKCS#1 signature in the document. Results can be extracted by com.pspdfkit.utils.Response.onSuccessEmpty or com.pspdfkit.utils.Response.onError

Link copied to clipboard
suspend fun getDataToSign(context: Context, signerOptions: SignerOptions): Response<Pair<ByteArray, HashAlgorithm>>

This function provides unsigned byte array that needs to be signed.

Link copied to clipboard
fun signDocument(context: Context, signerOptions: SignerOptions, customSigning: suspend (ByteArray, String) -> ByteArray? = null, onFailure: (Throwable) -> Unit, onSuccess: () -> Unit)

signDocument provides functionality to insert a digital signature in a document

Link copied to clipboard
suspend fun signWithBasicSignature(context: Context, signerOptions: SignerOptions, unsignedData: ByteArray, hashAlgorithm: HashAlgorithm): Response<ByteArray>

This function is used to provide a complete PKCS#7 signature in the document with com.pspdfkit.signatures.DigitalSignatureType.BASIC digital signature type. Results can be extracted by com.pspdfkit.utils.Response.onSuccess or com.pspdfkit.utils.Response.onError

Link copied to clipboard
suspend fun signWithCAdESSignature(context: Context, signerOptions: SignerOptions, unsignedData: ByteArray, hashAlgorithm: HashAlgorithm): Response<ByteArray>

This function is used to provide a complete PKCS#7 signature in the document with com.pspdfkit.signatures.DigitalSignatureType.CADES digital signature type. Results can be extracted by com.pspdfkit.utils.Response.onSuccess or com.pspdfkit.utils.Response.onError