@protocol PSPDFDocumentSignerDelegate <NSObject>


protocol PDFDocumentSignerDelegate : NSObjectProtocol

A PSPDFDocumentSignerDelegate gives flexibility to the process of adding a digital signature to a document.

Implement the documentSigner:signData:hashAlgorithm:completion method to sign the required data and invoke completion when ready. The document signer will automatically embed the signed data inside the signature.

  • Invoked when the document signer needs to sign the parts of the document that will be covered by the digital signature. data is the data content that you will need to hash and sign. hashAlgorithm indicates which hash algorithm needs to be used. You can customize it by setting a custom PSPDFSignerDataSource as the dataSource property of a PSPDFSigner. If you are unable to sign the required data, call completion(NO, nil); to abort the signing process.

    @note: See method - [PSPDFSigner signData:privateKey:hashAlgorithm:], which is a convenience method you can use to sign data.



    - (void)documentSigner:(nonnull PSPDFSigner *)signer
                  signData:(nonnull NSData *)data
                completion:(nonnull PSPDFDocumentSignDataCompletionBlock)completion;


    func documentSigner(_ signer: PSPDFSigner, sign data: Data, hashAlgorithm: PDFSignatureHashAlgorithm) async -> (Bool, Data?)