@protocol PSPDFSignatureContents <NSObject>

An interface for producing content that will be inside the Contents key of a signature dictionary.

This interface abstracts the digital signature that can be in a signature form field so that you can create your own and place it inside the document. You can call [PSPDFSigner prepareFormElementToBeSigned:withAppearance:withContents:writeToDataSink:completionBlock] and pass an instance of this interface to prepare a document for digital signing.

  • Given some dataToSign, return the digital signature contents that will be placed in the PDF document. dataToSign is the raw range of the PDF document that should be covered by the signature. In a specific implementation, you may hash the data, encrypt it, and then return it serialized in PKCS#7 format (



    - (nonnull NSData *)signData:(nonnull NSData *)dataToSign;


    func sign(_ dataToSign: Data) -> Data