PSPDFSigner


@interface PSPDFSigner : NSObject

PSPDFSigner is an abstract signer class. Override methods in subclasses as necessary.

  • (Override) The PDF filter name to use for this signer. Typical values are Adobe.PPKLite, Entrust.PPKEF, CICI.SignIt, and VeriSign.PPKVS. Returns Adobe.PPKLite as default value.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSString *_Nonnull filter;

    Swift

    var filter: String { get }
  • (Override) The PDF SubFilter entry value. Typical values are adbe.x509.rsa_sha1, adbe.pkcs7.detached, and adbe.pkcs7.sha1. Returns adbe.pkcs7.detached as default value.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSString *_Nonnull subFilter;

    Swift

    var subFilter: String { get }
  • (Override) The name displayed in the UI.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSString *_Nonnull displayName;

    Swift

    var displayName: String { get }
  • (Override) This method requests the signing certificate on demand. If the certificate is for instance password protected or must be fetched over the network, you can push a custom UIViewController on the passed navigation controller to display a custom UI while unlocking/fetching the certificate. If you are done, call the done handler with the fetched certificate and/or and error value. sourceController should be of type UINavigationController.

    Declaration

    Objective-C

    - (void)requestSigningCertificate:(nonnull id)sourceController
                      completionBlock:
                          (nullable void (^)(PSPDFX509 *_Nullable,
                                             NSError *_Nullable))completionBlock;

    Swift

    func requestSigningCertificate(_ sourceController: Any, completionBlock: ((PSPDFX509?, Error?) -> Void)? = nil)
  • (Optional) Signs the passed form element |elem| and writes the signed document to |path|. Returns YES for |success|, NO otherwise and error |err| is set.

    Declaration

    Objective-C

    - (void)signFormElement:(nonnull PSPDFSignatureFormElement *)element
            withCertificate:(nonnull PSPDFX509 *)x509
                    writeTo:(nonnull NSString *)path
            completionBlock:(nullable void (^)(BOOL, PSPDFDocument *_Nullable,
                                               NSError *_Nullable))completionBlock;

    Swift

    func sign(_ element: PSPDFSignatureFormElement, withCertificate x509: PSPDFX509, writeTo path: String, completionBlock: ((Bool, PSPDFDocument?, Error?) -> Void)? = nil)