PSPDFSigner


@interface PSPDFSigner : NSObject <NSCoding>

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) The reason for the signature.

    Declaration

    Objective-C

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

    Swift

    var reason: String { get }
  • (Override) The location for the signature.

    Declaration

    Objective-C

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

    Swift

    var location: 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 *)certificate
                    writeTo:(nonnull NSString *)path
                 appearance:(nullable PSPDFSignatureAppearance *)signatureAppearance
        biometricProperties:
            (nullable PSPDFSignatureBiometricProperties *)biometricProperties
            completionBlock:(nullable void (^)(BOOL, PSPDFDocument *_Nullable,
                                               NSError *_Nullable))completionBlock;

    Swift

    func sign(_ element: PSPDFSignatureFormElement, withCertificate certificate: PSPDFX509, writeTo path: String, appearance signatureAppearance: PSPDFSignatureAppearance?, biometricProperties: PSPDFSignatureBiometricProperties?, completionBlock: ((Bool, PSPDFDocument?, Error?) -> Void)? = nil)

    Parameters

    element

    The signature form element to sign.

    certificate

    The PSPDFX509 instance that represents the certificate for signing the signature form element.

    path

    The destination path for the signed document.

    signatureAppearance

    The PSPDFSignatureAppearance instance that customizes how the signature will appear in the signed document. If nil, the default signature appearance will be used.

    biometricProperties
    The `PSPDFSignatureBiometricProperties` instance that adds enhanced security properties to the signature,
    

    like input pressure, type, etc.

  • (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 *)certificate
            writeToDataSink:(nonnull id<PSPDFDataSink>)dataSink
                 appearance:(nullable PSPDFSignatureAppearance *)signatureAppearance
        biometricProperties:
            (nullable PSPDFSignatureBiometricProperties *)biometricProperties
            completionBlock:(nullable void (^)(BOOL, id<PSPDFDataSink> _Nullable,
                                               NSError *_Nullable))completionBlock;

    Swift

    func sign(_ element: PSPDFSignatureFormElement, withCertificate certificate: PSPDFX509, writeTo dataSink: PSPDFDataSink, appearance signatureAppearance: PSPDFSignatureAppearance?, biometricProperties: PSPDFSignatureBiometricProperties?, completionBlock: ((Bool, PSPDFDataSink?, Error?) -> Void)? = nil)

    Parameters

    element

    The signature form element to sign.

    certificate

    The PSPDFX509 instance that represents the certificate for signing the signature form element.

    dataSink

    The destination data sink for the signed document.

    signatureAppearance

    The PSPDFSignatureAppearance instance that customizes how the signature will appear in the signed document. If nil, the default signature appearance will be used.

    biometricProperties
    The `PSPDFSignatureBiometricProperties` instance that adds enhanced security properties to the signature,
    

    like input pressure, type, etc.