Foxit PDF SDK
|
Instance Methods | |
(BOOL) | - clearSignedData |
Clear the data and appearance if current signature is singed and verified valid. More... | |
(void) | - enableEmbedFont: |
Enable or disable embed font. More... | |
(void) | - enableIncrementalSaveForFirstSigning: |
Enable or disable incremental save for first signing. User should call this function before calling function FSSignature::startSignWithStreamCallback:cert_password:digest_algorithm:stream_callback:client_data:pause:. Default: NO. More... | |
(BOOL) | - generateAppearance |
Generate the appearance of unsigned signature. More... | |
(FSInt32Array *) | - getByteRangeArray |
Get the byte ranges data, including 4 elements. More... | |
(NSString *) | - getCert: |
Get a certificate from current signature's certificate chain by index. More... | |
(int) | - getCertCount |
Get the count of certificates in current signature's certificate chain. More... | |
(NSString *) | - getCertificateInfo: |
Get certificate information. More... | |
(FSPDFDoc *) | - getDocument |
Get the PDF document, which current signature belongs to. More... | |
(FSSignatureFieldMDPAction) | - getFieldMDPAction |
Get FieldMDP("MDP" means modification detection and prevention) action type. More... | |
(NSArray< NSString * > *) | - getFieldMDPActionFields |
Get the field name array which is used for FieldMDP action. More... | |
(NSString *) | - getKeyLabel: |
Get the string for specified key label. More... | |
(NSString *) | - getKeyValue: |
Get the string value for specified key name. More... | |
(FSSignaturePAdESLevel) | - getPAdESLevel |
Get PAdES level. More... | |
(FSSignatureArray *) | - getPagingSealGroupElements |
Get the group elements of current paging seal signature. More... | |
(FSPagingSealSignature *) | - getPagingSealSignature |
Get the paging seal signature. More... | |
(FSPDFDictionary *) | - getSignatureDict |
Get signature dictionary. More... | |
(FSSignatureSignatureType) | - getSignatureType |
Get signature type. More... | |
(FSPDFDoc *) | - getSignedVersionDocument: |
Get the PDF document in the signed version in which current signature was signed. More... | |
(unsigned int) | - getState |
Get current state. More... | |
(id) | - initWithDocument:sig_field_dict: |
Constructor, from signature field dictionary. More... | |
(id) | - initWithField: |
Constructor, with parent class object. More... | |
(BOOL) | - isEmpty |
Check whether current object is empty or not. More... | |
(BOOL) | - isSigned |
Check whether current signature is signed or not. More... | |
(BOOL) | - isTimeStamp |
Check if current signature is a time stamp signature. More... | |
(void) | - setAppearanceContent: |
Set customized appearance content (as low level drawing operation commands) for signed signature appearance. More... | |
(void) | - setCertChain: |
Set a certificate chain. More... | |
(void) | - setCustomObject:pdf_object: |
Set custom PDF object for signature dictionary. More... | |
(void) | - setDefaultContentsLength: |
Set the default length of signature contents which represents signature value (known as signed data). More... | |
(void) | - setFieldMDPActionFields:field_array: |
Set FieldMDP("MDP" means modification detection and prevention) action names array. More... | |
(void) | - setImage:frame_index: |
Set an image for the signature appearance, with a specified frame index. More... | |
(void) | - setImageWithFilePath:frame_index: |
Set an image for the signature appearance, with a specified frame index. More... | |
(void) | - setKeyLabel:label_value: |
Set the string for specified key label. More... | |
(void) | - setKeyValue:value: |
Set the string value for specified key name. More... | |
(FSProgressive *) | - startSign:cert_password:digest_algorithm:save_path:client_data:pause: |
Start signing current signature if current signature is unsigned. More... | |
(FSProgressive *) | - startSignWithCertFileStreamCallback:cert_password:digest_algorithm:stream_callback:client_data:pause: |
Start signing current signature if current signature is unsigned. More... | |
(FSProgressive *) | - startSignWithStreamCallback:cert_password:digest_algorithm:stream_callback:client_data:pause: |
Start signing current signature if current signature is unsigned. More... | |
(FSProgressive *) | - startVerify:pause: |
Start verifying the intergrity of current signature if current signature is signed. More... | |
![]() | |
(FSControl *) | - getControl: |
Get a form control by index. More... | |
(int) | - getControlCount |
Get count of form controls. More... | |
(int) | - getControlCountWithPDFPage: |
Get count of form controls in a specified PDF page. More... | |
(FSControl *) | - getControlWithPDFPage:index: |
Get a form control by index, in a specified PDF page. More... | |
(FSPDFObject *) | - getDefaultValueObj |
Get the PDF object of field's default value. More... | |
(FSPDFDictionary *) | - getDict |
Get the PDF dictionary of current object. More... | |
(FSPDFObject *) | - getInheritedAttribute: |
Get the PDF object for specified attribute which may be inherited from the ancestor node in the field tree. More... | |
(NSString *) | - getName |
Get field name. More... | |
(FSFieldType) | - getType |
Get field type. More... | |
(FSPDFObject *) | - getValueObj |
Get the PDF object of field's value. More... | |
(id) | - initWithDocument:field_dict: |
Constructor, from field dictionary. More... | |
(BOOL) | - reset |
Reset data in current field to its default value. (Not support signature field) More... | |
Properties | |
unsigned int | appearanceFlags |
Get or Set signature appearance flags. More... | |
FSBitmap * | bitmap |
Get or Set a bitmap which is used for the signature appearance. | |
FSSignatureDocPermission | docPermission |
Get or Set document permission for current signature. More... | |
NSString * | filter |
Get or Set filter. More... | |
FSDateTime * | signTime |
Get or Set time of signing. | |
NSString * | subFilter |
Get or Set sub filter. More... | |
![]() | |
FSAlignment | alignment |
Get or Set the alignment value. More... | |
NSString * | alternateName |
Get or Set alternate name. More... | |
FSDefaultAppearance * | defaultAppearance |
Get or Set the default appearance data. | |
NSString * | defaultValue |
Get or Set default value. More... | |
unsigned int | flags |
Get or Set field flags. More... | |
NSString * | mappingName |
Get or Set mapping name. More... | |
int | maxLength |
Get or Set maximum length of the field's text, in characters. More... | |
FSChoiceOptionArray * | options |
Get or Set options of list box or combo box. More... | |
int | topVisibleIndex |
Get or Set top index of option for scrollable list boxes. More... | |
NSString * | value |
Get or Set value. More... | |
A digital signature (PDF 1.3) can be used to authenticate the identity of a user and the document's contents. It stores information about the signer and the state of the document when it was signed. The signature is contained in a signature field, as a type of form field, so class FSSignature is derived from class FSField. A signature object can be retrieved/added by following functions:
In a signature, filter and sub filter keys are used to specify the filter and sub filter of signature callback object which will be used to sign and verify the signature. Foxit PDF SDK has default signature callbacks for following filter and sub filter:
For sub filter "ETSI.CAdES.detached" and sub filter "ETSI.RFC3161", please ensure a default time stmap server has been set to FSTimeStampServerMgr if default signature callbacks for them will be used to do signing. For other filter and sub filter or if user wants to use customized signature callback for above filter and sub filter, user should prepare customized signature callback and register the callback to Foxit PDF SDK by function FSLibrary::registerSignatureCallback:sub_filter:signature_callback:.
This class offers functions to get/set signature information/properties, sign or verify a signature, and so on. For example:
Before signing an unsigned signature, user can call following functions to set information for signing and signed appearance:
If an unsigned signature has been set some information for signing, but the document is saved directly or closed without signing the signature, these data (including filter and sub filter) will be lost in the saved document or in the closed document. When the document is opened again, the unsigned signature needs to be specified at least filter and sub filter for signing; otherwise, this signature cannot be signed.
- (BOOL) clearSignedData |
Clear the data and appearance if current signature is singed and verified valid.
This function is used for a signed and valid signature.
Attention: From 7.0, this function is only used to verify the intergrity of a signature. To check if a signature is valid or not, please refer to class FSLTVVerifier .
- (void) enableEmbedFont: | (BOOL) | enable_embed_font |
Enable or disable embed font.
A | flag indicates that whether to embed font for siganture's text. YES means that embed font for siganture's text. NO means that not to embed font for siganture's text. |
- (void) enableIncrementalSaveForFirstSigning: | (BOOL) | enable_incremental_save |
Enable or disable incremental save for first signing. User should call this function before calling function FSSignature::startSignWithStreamCallback:cert_password:digest_algorithm:stream_callback:client_data:pause:.
Default: NO.
[in] | enable_incremental_save | A flag indicates that whether to use incremental save for first signing. YES means that use incremental save for first signing. NO means that use default save for first signing. |
- (BOOL) generateAppearance |
Generate the appearance of unsigned signature.
This function is used to display the unsigned ordinary signature on page without calling the function FSSignature::startSignWithStreamCallback:cert_password:digest_algorithm:stream_callback:client_data:pause:.
Reimplemented in FSPagingSealSignature.
- (FSInt32Array *) getByteRangeArray |
Get the byte ranges data, including 4 elements.
This function is used for a signed signature to retrieve its byte range for digest calculation. The array of byte ranges contains 4 elements. These 4 elements are always in pairs of integers (starting byte offset, length in bytes), describing the exact byte range for the digest calculation.
Please refer to <PDF Reference 1.7> Section 8.7 Digital Signatures for more details.
- (NSString *) getCert: | (int) | index |
Get a certificate from current signature's certificate chain by index.
This function is recommended to be used before verifying a signature. When sub filter of current signature is "adbe.x509.rsa_sha1", application needs to call this function to get verified public certificate before verifying signature. The first certificate in certificate chain is the signing certificate, and it can be used to verify the signature.
[in] | index | The index of certificate to be gotten. Valid range: from 0 to (count-1). count is returned by function FSSignature::getCertCount. |
- (int) getCertCount |
Get the count of certificates in current signature's certificate chain.
This function is recommended to be used before verifying a signature. When sub filter of current signature is "adbe.x509.rsa_sha1", application needs to call this function to get the count of certificates in certificate chain and then call function FSSignature::getCert: to get verified public certificate before verifying signature.
- (NSString *) getCertificateInfo: | (NSString *) | key |
Get certificate information.
This function is used for a signed signature. Currently, this function only supports for iOS and android platform.
[in] | key | Certificate key string. Currently it can be one of the following keys:
|
- (FSPDFDoc *) getDocument |
Get the PDF document, which current signature belongs to.
- (FSSignatureFieldMDPAction) getFieldMDPAction |
Get FieldMDP("MDP" means modification detection and prevention) action type.
- (NSArray< NSString * > *) getFieldMDPActionFields |
Get the field name array which is used for FieldMDP action.
Returned field name array is associated to the FieldMDP action (which can be checked by function FSSignature::getFieldMDPAction):
- (NSString *) getKeyLabel: | (FSSignatureLabelName) | label_name |
Get the string for specified key label.
If current signature is a time stamp signature, this function will always return an empty string.
[in] | label_name | Key label. Please refer to values starting from FSSignatureLabelNameSigner and this should be one of these values. |
- (NSString *) getKeyValue: | (FSSignatureKeyName) | key |
Get the string value for specified key name.
This function is used to get string value of some key in signature dictionary, such as "Reason", "Location" and so on. Specially,
[in] | key | Key name. Please refer to values starting from FSSignatureKeyNameSigner and this should be one of these values. |
- (FSSignaturePAdESLevel) getPAdESLevel |
Get PAdES level.
- (FSSignatureArray *) getPagingSealGroupElements |
Get the group elements of current paging seal signature.
If current signature type is FSSignatureSignatureTypePagingSeal, this function will return the array of signature associated with current signature. Otherwise, an empty array will be returned.
- (FSPagingSealSignature *) getPagingSealSignature |
Get the paging seal signature.
If current signature type is FSSignatureSignatureTypePagingSeal, this function will return the paging seal signature object associated with current signature.
- (FSPDFDictionary *) getSignatureDict |
Get signature dictionary.
Signature dictionary is a part of signature field dictionary.
- (FSSignatureSignatureType) getSignatureType |
Get signature type.
- (FSPDFDoc *) getSignedVersionDocument: | (NSString *) | file_path |
Get the PDF document in the signed version in which current signature was signed.
This function is useful when a PDF document has benn signed by serveral signatures and user wants to get the PDF document in which one signature is signed.
[in] | file_path | The full path of the original opened PDF document which current signature belongs to. It should not be an empty string. |
- (unsigned int) getState |
Get current state.
- (id) initWithDocument: | (FSPDFDoc*) | document | |
sig_field_dict: | (FSPDFDictionary*) | sig_field_dict | |
Constructor, from signature field dictionary.
[in] | document | A valid PDF document. |
[in] | sig_field_dict | A PDF dictionary which represents a signature field. It should belong to the PDF document specified by parameter document; |
- (id) initWithField: | (FSField*) | field |
Constructor, with parent class object.
[in] | field | Parent class object. |
Reimplemented from FSField.
- (BOOL) isEmpty |
Check whether current object is empty or not.
When the current object is empty, that means current object is useless.
Reimplemented from FSField.
- (BOOL) isSigned |
Check whether current signature is signed or not.
- (BOOL) isTimeStamp |
Check if current signature is a time stamp signature.
- (void) setAppearanceContent: | (NSString *) | appearance_content |
Set customized appearance content (as low level drawing operation commands) for signed signature appearance.
This function can only be used for an unsigned signature before calling function FSSignature::startSignWithStreamCallback:cert_password:digest_algorithm:stream_callback:client_data:pause: for the unsigned signature.
Once customized appearance content is set, it will be used as the signed appearance. In this case, appearance flags set by FSSignature::appearanceFlags will be ignored and related informations will not be used in appearance – these information are set by: FSSignature::signTime, FSSignature::setKeyValue:value: (except filter and sub-filter), FSSignature::bitmap, FSSignature::setImage:frame_index:.
If current signature is a time stamp signature, this function will do nothing.
[in] | appearance_content | Customized appearance content. This should be sequence of drawing operation commands to be used for the appearance, for example "10 10 m 20 10 l S". Please refer to <PDF Reference 1.7> P196 for more details. |
- (void) setCertChain: | (NSArray<NSString *> *) | cert_chain |
Set a certificate chain.
This function is recommended to be used before signing an unsigned signature. When the signature sub filter is "adbe.x509.rsa_sha1", users need to call this function to set the cert chain to the signature. For other sub filter, this function will return directly without doing anything.
[in] | cert_chain | A string array that represents the certificate chain. |
- (void) setCustomObject: | (NSString *) | key | |
pdf_object: | (FSPDFObject*) | pdf_object | |
Set custom PDF object for signature dictionary.
This function is recommended to be used before calling function FSSignature::startSignWithStreamCallback:cert_password:digest_algorithm:stream_callback:client_data:pause: for an unsigned signature.
[in] | key | The key of signature dictionary, whose value element will be set. It should not be an empty string. |
[in] | pdf_object | A custom FSPDFObject object to be set as the key's value. It should not be nil. It can be a direct PDF object or an indirect PDF object. |
- (void) setDefaultContentsLength: | (unsigned int) | default_length |
Set the default length of signature contents which represents signature value (known as signed data).
This function can only be used before function FSSignature::startSignWithStreamCallback:cert_password:digest_algorithm:stream_callback:client_data:pause: for an unsigned signature.
Signature contents represent the signature value (known as signed data). When initializing the signature field, the signature contents will be initialized with the default length 7942. When using custom signature callback to sign and verify an unsigned signature, user can call this function to change the default length of signature contents. In this case, user should also ensure that the length of returned signed data in callback function FSSignatureCallback::sign:cert_path:cert_password:digest_algorithm:client_data: should not be larger than the default length set by this function.
[in] | default_length | The default length of the signature value (known as signed data), in bytes. It should not be less than 4098. |
- (void) setFieldMDPActionFields: | (FSSignatureFieldMDPAction) | action | |
field_array: | (NSArray<NSString *> *) | field_array | |
Set FieldMDP("MDP" means modification detection and prevention) action names array.
This function is only useful for an unsigned signature. If this function is used for a signed signature, nothing will be done.
If current signature is signed, this function is invalidate.
[in] | action | FieldMDP action type.Please refer to values starting from FSSignatureFieldMDPActionNone and this should be one of these values.
|
[in] | field_array | A field name array used for FieldMDP action. |
- (void) setImage: | (FSImage*) | image | |
frame_index: | (int) | frame_index | |
Set an image for the signature appearance, with a specified frame index.
This function is recommended to be used before calling function FSSignature::startSignWithStreamCallback:cert_password:digest_algorithm:stream_callback:client_data:pause: for an unsigned signature. If customized appearance content has been set by function FSSignature::setAppearanceContent:, the image will not be used in signed appearance.
Input image may contain multiple frames, and only one frame of the image can be set to current signature.
If current signature is a time stamp signature, this function will do nothing.
[in] | image | An image. One of its frames will be set to current signature. This image contains at least one frame and the image type should not be FSImageUnknown. |
[in] | frame_index | Frame index. Valid range: from 0 to (count-1). count is returned by function FSImage::getFrameCount. |
- (void) setImageWithFilePath: | (NSString *) | file_path | |
frame_index: | (int) | frame_index | |
Set an image for the signature appearance, with a specified frame index.
This function is recommended to be used before calling function FSSignature::startSignWithStreamCallback:cert_password:digest_algorithm:stream_callback:client_data:pause: for an unsigned signature. If customized appearance content has been set by function FSSignature::setAppearanceContent:, the image will not be used in signed appearance.
Input image may contain multiple frames, and only one frame of the image can be set to current signature.
If current signature is a time stamp signature, this function will do nothing.
[in] | file_path | A full path of an existing image file. It should not be an empty string. |
[in] | frame_index | Frame index. Valid range: from 0 to (count-1). count is returned by function FSImage::getFrameCount of input image file. |
- (void) setKeyLabel: | (FSSignatureLabelName) | label_name | |
label_value: | (NSString *) | label_value | |
Set the string for specified key label.
This function is recommended to be used before calling function FSSignature::startSignWithStreamCallback:cert_password:digest_algorithm:stream_callback:client_data:pause: for an unsigned signature.
This function is used to set string value for custom label of some key in signature dictionary. If no custom label is set, default labels will be used by Foxit PDF SDK. Please refer to comment of values starting from FSSignatureLabelNameSigner for more details.
If current signature is a time stamp signature, this function will do nothing.
[in] | label_name | Key label. Please refer to values starting from FSSignatureLabelNameSigner and this should be one of these values. |
[in] | label_value | New string value for key label. If this is an empty string, Foxit PDF SDK will use default label. Please refer to comment of values starting from FSSignatureLabelNameSigner for more details. |
- (void) setKeyValue: | (FSSignatureKeyName) | key | |
value: | (NSString *) | value | |
Set the string value for specified key name.
This function is recommended to be used before calling function FSSignature::startSignWithStreamCallback:cert_password:digest_algorithm:stream_callback:client_data:pause: for an unsigned signature.
This function is used to set string value of some key in signature dictionary, such as signer, reason, location and so on.
If current signature is a time stamp signature, this function will do nothing.
[in] | key | Key name. Please refer to values starting from FSSignatureKeyNameSigner and this should be one of these values. |
[in] | value | New string value. |
- (FSProgressive *) startSign: | (NSString *) | cert_path | |
cert_password: | (NSString *) | cert_password | |
digest_algorithm: | (FSSignatureDigestAlgorithm) | digest_algorithm | |
save_path: | (NSString *) | save_path | |
client_data: | (NSData *) | client_data | |
pause: | (id<FSPauseCallback>) | pause | |
Start signing current signature if current signature is unsigned.
This function is used for an unsigned signature. Filter and sub filter keys of current signature specify the name of signature callback object which will be used to sign current signature. So before signing, please ensure current signature has valid filter and sub filter string values. If the filter and sub filter are one of following strings that means to use the default signature callback in Foxit PDF SDK:
For other filter and sub filter or if user wants to use customized signature callback for above filter and sub filter, please ensure a customized signature callback has been registered to Foxit PDF SDK by function FSLibrary::registerSignatureCallback:sub_filter:signature_callback:.
For PDF documents that are compliant with PDF/A specification, FSLibrary::setDefaultICCProfilesPath: is recommended to be called and enable embeding font by calling FSSignature::enableEmbedFont: before calling current function. It may take a long time to sign a signature, so Foxit PDF SDK uses a progressive process to do this.
[in] | cert_path | A full path of a certificate file (including file name and extension), which will be used for signing. This can be an empty string if not necessary in custom signature callback. When this file path is not empty, it should be a valid path. If default signature callback is to be used for signing current signature, this can be a PFX certificate file. |
[in] | cert_password | A password string used to open the cert file. If this is an empty string, that means no password is required. |
[in] | digest_algorithm | The algorithm of message digest for signed data. Please refer to values starting from FSSignatureDigestSHA1 and this should be one of these values. |
[in] | save_path | A full PDF file path for saving the signing result. The signed document would be saved to another PDF file. |
[in] | client_data | A user-defined object, which will be passed to call back functions in FSSignatureCallback . This is useless if the default callback object will be used to sign current signature. |
[in] | pause | Pause object which decides if the signing process needs to be paused. This can be nil which means not to pause during the signing process. If this is not nil, it should be a valid pause object implemented by user. |
- (FSProgressive *) startSignWithCertFileStreamCallback: | (id<FSFileStreamCallback>) | cert_file_stream | |
cert_password: | (NSString *) | cert_password | |
digest_algorithm: | (FSSignatureDigestAlgorithm) | digest_algorithm | |
stream_callback: | (id<FSFileStreamCallback>) | stream_callback | |
client_data: | (NSData *) | client_data | |
pause: | (id<FSPauseCallback>) | pause | |
Start signing current signature if current signature is unsigned.
This function is used for an unsigned signature. Filter and sub filter keys of current signature specify the name of signature callback object which will be used to sign current signature. So before signing, please ensure current signature has valid filter and sub filter string values. If the filter and sub filter are one of following strings that means to use the default signature callback in Foxit PDF SDK:
For sub filter "ETSI.CAdES.detached" and sub filter "ETSI.RFC3161", please ensure a default time stmap server has been set to FSTimeStampServerMgr if default signature callbacks for them will be used to do signing. For other filter and sub filter or if user wants to use customized signature callback for above filter and sub filter, please ensure a customized signature callback has been registered to Foxit PDF SDK by function FSLibrary::registerSignatureCallback:sub_filter:signature_callback:.
For PDF documents that are compliant with PDF/A specification, FSLibrary::setDefaultICCProfilesPath: is recommended to be called and enable embeding font by calling FSSignature::enableEmbedFont: before calling current function. It may take a long time to sign a signature, so Foxit PDF SDK uses a progressive process to do this.
[in] | cert_file_stream | A FSFileStreamCallback object which is implemented by user to access content of a certificate file which will be used for signing. This can be nil if not necessary in custom signature callback. If default signature callback is to be used for signing current signature, a PFX certificate file can be used. |
[in] | cert_password | A password string used to open the cert file. If this is an empty string, that means no password is required. |
[in] | digest_algorithm | The algorithm of message digest for signed data. Please refer to values starting from FSSignatureDigestSHA1 and this should be one of these values. |
[in] | stream_callback | A FSFileStreamCallback object which is implemented by user to save the signing result. The signed document would be saved to another PDF file. |
[in] | client_data | A user-defined object, which will be passed to call back functions in FSSignatureCallback . This is useless if the default callback object will be used to sign current signature. |
[in] | pause | Pause object which decides if the signing process needs to be paused. This can be nil which means not to pause during the signing process. If this is not nil, it should be a valid pause object implemented by user. |
- (FSProgressive *) startSignWithStreamCallback: | (NSString *) | cert_path | |
cert_password: | (NSString *) | cert_password | |
digest_algorithm: | (FSSignatureDigestAlgorithm) | digest_algorithm | |
stream_callback: | (id<FSFileStreamCallback>) | stream_callback | |
client_data: | (NSData *) | client_data | |
pause: | (id<FSPauseCallback>) | pause | |
Start signing current signature if current signature is unsigned.
This function is used for an unsigned signature. Filter and sub filter keys of current signature specify the name of signature callback object which will be used to sign current signature. So before signing, please ensure current signature has valid filter and sub filter string values. If the filter and sub filter are one of following strings that means to use the default signature callback in Foxit PDF SDK:
For sub filter "ETSI.CAdES.detached" and sub filter "ETSI.RFC3161", please ensure a default time stmap server has been set to FSTimeStampServerMgr if default signature callbacks for them will be used to do signing. For other filter and sub filter or if user wants to use customized signature callback for above filter and sub filter, please ensure a customized signature callback has been registered to Foxit PDF SDK by function FSLibrary::registerSignatureCallback:sub_filter:signature_callback:.
For PDF documents that are compliant with PDF/A specification, FSLibrary::setDefaultICCProfilesPath: is recommended to be called and enable embeding font by calling FSSignature::enableEmbedFont: before calling current function. It may take a long time to sign a signature, so Foxit PDF SDK uses a progressive process to do this.
[in] | cert_path | A full path of a certificate file (including file name and extension), which will be used for signing. This can be an empty string if not necessary in custom signature callback. When this file path is not empty, it should be a valid path. If default signature callback is to be used for signing current signature, this can be a PFX certificate file. |
[in] | cert_password | A password string used to open the cert file. If this is an empty string, that means no password is required. |
[in] | digest_algorithm | The algorithm of message digest for signed data. Please refer to values starting from FSSignatureDigestSHA1 and this should be one of these values. |
[in] | stream_callback | A FSFileStreamCallback object which is implemented by user to save the signing result. The signed document would be saved to another PDF file. |
[in] | client_data | A user-defined object, which will be passed to call back functions in FSSignatureCallback . This is useless if the default callback object will be used to sign current signature. |
[in] | pause | Pause object which decides if the signing process needs to be paused. This can be nil which means not to pause during the signing process. If this is not nil, it should be a valid pause object implemented by user. |
- (FSProgressive *) startVerify: | (NSData *) | client_data | |
pause: | (id<FSPauseCallback>) | pause | |
Start verifying the intergrity of current signature if current signature is signed.
This function is used for a signed signature. Filter and sub filter keys of current signature specify the name of signature callback object which will be used to verify current signature. So before verifying, please ensure: the necessary signature callback object has been registered by function FSLibrary::registerSignatureCallback:sub_filter:signature_callback:. If the filter and sub filter of current signed signature are one of following strings that means to use the default signature callback in Foxit PDF SDK and user does not need to register one for them:
It may take a long time to verify a signature, so Foxit PDF SDK uses a progressive process to do this.
From 7.0, this function is only used to verify the intergrity of a signature. To check if a signature is valid or not, please refer to class FSLTVVerifier .
[in] | client_data | A user-defined object, which will be passed to call back functions in FSSignatureCallback . This is useless if the default callback object will be used to verify current signature. |
[in] | pause | Pause object which decides if the verifying process needs to be paused. This can be nil which means not to pause during the verifying process. If this is not nil, it should be a valid pause object implemented by user. |
|
readwritenonatomicassign |
Get or Set signature appearance flags.
Signature appearance flags indicate which information will be shown. Currently, this is only useful after FSSignature::appearanceFlags is set successfully. For a signature gotten from PDF document, the return value of this function would be useless.
|
readwritenonatomicassign |
Get or Set document permission for current signature.
|
readwritenonatomicweak |
Get or Set filter.
Filter and sub filter are used to specify which registered signature callback object will be used to sign/verify current signature.
|
readwritenonatomicweak |
Get or Set sub filter.
Filter and sub filter are used to specify which registered signature callback object will be used to sign/verify current signature.