PSPDFDocumentSignerDataSource

Objective-C

@protocol PSPDFDocumentSignerDataSource <NSObject>

Swift

protocol PDFDocumentSignerDataSource : NSObjectProtocol

A data source that, when configured on a PSPDFSigner instance or one of its subclasses, gives implementors a chance to configure some details of a digital signature.

  • Gives the implementor a chance to configure the signature appearance for a form field.

    Note

    If not implemented, PSPDFSignatureAppearance.defaultConfiguration will be used.

    Declaration

    Objective-C

    - (nonnull PSPDFSignatureAppearance *)
             documentSigner:(nonnull PSPDFSigner *)signer
        signatureAppearance:(nonnull NSString *)formFieldFqn;

    Swift

    optional func documentSigner(_ signer: PSPDFSigner, signatureAppearance formFieldFqn: String) -> PSPDFSignatureAppearance
  • Gives the implementor a chance to configure the signature estimated size (in bytes) for a form field. This is the size that you expect your signature container will need in the PDF. The estimated size will be reserved in the PDF document before digitally signing it, but PSPDFKit may reserve around the double of that space to fit some implementation details. A big estimated size will possibly make the signed document bigger than necessary, but a too small one will cause the signing process to fail. For complex certificates, we recommend this method returns around 16 KB, but this number may need to be even larger depending on the size of the signing certificate.

    Note

    If not implemented, 8 KB will be used, which will occupy more or less double that size (16 KB) in the PDF. The returned value will be clamped between 0 and 256 KB (262144 bytes).

    Declaration

    Objective-C

    - (int32_t)documentSigner:(nonnull PSPDFSigner *)signer
        signatureEstimatedSize:(nonnull NSString *)formFieldFqn;

    Swift

    optional func documentSigner(_ signer: PSPDFSigner, signatureEstimatedSize formFieldFqn: String) -> Int32
  • Gives the implementor a chance to configure biometric properties for this signature. Biometric properties are optional metadata that will be stored encrypted inside the signature dictionary.

    Note

    If not implemented, no biometric properties will be embedded.

    Declaration

    Objective-C

    - (nonnull PSPDFSignatureBiometricProperties *)
                      documentSigner:(nonnull PSPDFSigner *)signer
        signatureBiometricProperties:(nonnull NSString *)formFieldFqn;

    Swift

    optional func documentSigner(_ signer: PSPDFSigner, signatureBiometricProperties formFieldFqn: String) -> PSPDFSignatureBiometricProperties
  • Gives the implementor a chance to select a digest algorithm for the signature.

    Note

    If not implemented, SHA256 will be used.

    Declaration

    Objective-C

    - (PSPDFSignatureHashAlgorithm)documentSigner:(nonnull PSPDFSigner *)signer
                           signatureHashAlgorithm:(nonnull NSString *)formFieldFqn;

    Swift

    optional func documentSigner(_ signer: PSPDFSigner, signatureHashAlgorithm formFieldFqn: String) -> PDFSignatureHashAlgorithm
  • Gives the implementor a chance to select an encryption algorithm for the signature.

    Note

    If not implemented, RSA will be used.

    Declaration

    Objective-C

    - (PSPDFSignatureEncryptionAlgorithm)
                      documentSigner:(nonnull PSPDFSigner *)signer
        signatureEncryptionAlgorithm:(nonnull NSString *)formFieldFqn;

    Swift

    optional func documentSigner(_ signer: PSPDFSigner, signatureEncryptionAlgorithm formFieldFqn: String) -> PDFSignatureEncryptionAlgorithm