Foxit PDF SDK
|
Public Member Functions | |
ClearSignedData () | |
Clear the data and appearance if current signature is singed and verified valid. More... | |
constructor (document, sig_field_dict) | |
Constructor, from signature field dictionary. More... | |
constructor (field) | |
Constructor, with parent class object. More... | |
EnableEmbedFont (enable_embed_font) | |
Enable or disable embed font. More... | |
EnableIncrementalSaveForFirstSigning (enable_incremental_save) | |
Enable or disable incremental save for first signing. User should call this function before calling function FSDK.Signature.StartSign. Default: false. More... | |
GenerateAppearance () | |
Generate the appearance of unsigned signature. More... | |
GetAppearanceFlags () | |
Get signature appearance flags. More... | |
GetBitmap () | |
Get a bitmap which is used for the signature appearance. More... | |
GetByteRangeArray (out_byte_range_array:[number, number, number, number]) | |
Get the byte ranges data, including 4 elements. More... | |
GetCert (index) | |
Get a certificate from current signature's certificate chain by index. More... | |
GetCertCount () | |
Get the count of certificates in current signature's certificate chain. More... | |
GetCertificateInfo (key) | |
Get certificate information. More... | |
GetDocPermission () | |
Get document permission for current signature. More... | |
GetDocument () | |
Get the PDF document, which current signature belongs to. More... | |
GetFieldMDPAction () | |
Get FieldMDP("MDP" means modification detection and prevention) action type. More... | |
GetFieldMDPActionFields () | |
Get the field name array which is used for FieldMDP action. More... | |
GetFilter () | |
Get filter. More... | |
GetKeyLabel (label_name) | |
Get the string for specified key label. More... | |
GetKeyValue (key) | |
Get the string value for specified key name. More... | |
GetPAdESLevel () | |
Get PAdES level. More... | |
GetPagingSealGroupElements () | |
Get the group elements of current paging seal signature. More... | |
GetPagingSealSignature () | |
Get the paging seal signature. More... | |
GetSignatureDict () | |
Get signature dictionary. More... | |
GetSignatureType () | |
Get signature type. More... | |
GetSignedVersionDocument (file_path) | |
Get the PDF document in the signed version in which current signature was signed. More... | |
GetSignTime () | |
Get time of signing. More... | |
GetState () | |
Get current state. More... | |
GetSubFilter () | |
Get sub filter. More... | |
IsEmpty () | |
Check whether current object is empty or not. More... | |
IsSigned () | |
Check whether current signature is signed or not. More... | |
IsTimeStamp () | |
Check if current signature is a time stamp signature. More... | |
SetAppearanceContent (appearance_content) | |
Set customized appearance content (as low level drawing operation commands) for signed signature appearance. More... | |
SetAppearanceFlags (appearance_flags) | |
Set signature appearance flags. More... | |
SetBitmap (bitmap) | |
Set a bitmap for the signature appearance. More... | |
SetCertChain (cert_chain) | |
Set a certificate chain. More... | |
SetCustomObject (key, pdf_object) | |
Set custom PDF object for signature dictionary. More... | |
SetDefaultContentsLength (default_length) | |
Set the default length of signature contents which represents signature value (known as signed data). More... | |
SetDocPermission (permission) | |
Set document permission for current signature. More... | |
SetFieldMDPActionFields (action, field_array) | |
Set FieldMDP("MDP" means modification detection and prevention) action names array. More... | |
SetFilter (filter) | |
Set filter. More... | |
SetImage (file_path, frame_index) | |
Set an image for the signature appearance, with a specified frame index. More... | |
SetImage (image, frame_index) | |
Set an image for the signature appearance, with a specified frame index. More... | |
SetKeyLabel (label_name, label_value) | |
Set the string for specified key label. More... | |
SetKeyValue (key, value) | |
Set the string value for specified key name. More... | |
SetSignTime (sign_time) | |
Set time of signing. More... | |
SetSubFilter (sub_filter) | |
Set sub filter. More... | |
StartSign (cert_file_stream, cert_password, digest_algorithm, save_path, client_data, pause) | |
Start signing current signature if current signature is unsigned. More... | |
StartSign (cert_path, cert_password, digest_algorithm, save_path, client_data, pause) | |
Start signing current signature if current signature is unsigned. More... | |
StartSign (cert_path, cert_password, digest_algorithm, stream_callback, client_data, pause) | |
Start signing current signature if current signature is unsigned. More... | |
StartVerify (client_data, pause) | |
Start verifying the intergrity of current signature if current signature is signed. More... | |
Public Attributes | |
e_StateVerifyNoSupportWay | |
Unsupported signature. | |
Static Public Attributes | |
static | e_APFlagBitmap |
If set, show bitmap on signature appearance. | |
static | e_APFlagDN |
If set, show distinguish name on signature appearance. | |
static | e_APFlagFoxitEditorFlag |
If set, show Foxit Editor content on signature appearance. | |
static | e_APFlagFoxitFlag |
Enumeration for signature appearance flags. More... | |
static | e_APFlagLabel |
If set, show label on signature appearance. | |
static | e_APFlagLocation |
If set, show location on signature appearance. | |
static | e_APFlagProducer |
If set, show producer content on signature appearance. | |
static | e_APFlagReason |
If set, show reason on signature appearance. | |
static | e_APFlagSigner |
If set, show signer on signature appearance. | |
static | e_APFlagSigningTime |
If set, show signing time on signature appearance. | |
static | e_APFlagText |
If set, show text content on signature appearance. | |
static | e_DigestSHA1 |
Enumeration for signature digest algorithm. More... | |
static | e_DigestSHA256 |
Signature digest algorithm: sha256 algorithm. | |
static | e_DigestSHA384 |
Signature digest algorithm: sha384 algorithm. | |
static | e_DigestSHA512 |
Signature digest algorithm: sha512 algorithm. | |
static | e_DocPermFillingFormAndSigning |
Permitted changes are filling in forms, instantiating page templates, and signing. Other changes will invalidate the signature. | |
static | e_DocPermFillingFormSigningAndAnnotating |
Permitted changes are the same as for 2, as well as annotation creation, deletion, and modification. Other changes will invalidate the signature. | |
static | e_DocPermNoChangesAllowed |
No changes to the PDF document (which is signed by the signture) are permitted. Any change to this kind of PDF document will invalidate the signature. | |
static | e_DocPermUnrestricted |
Enumeration for signature document permission. More... | |
static | e_FieldMDPActionAll |
All form fields' flags will be set read-only. | |
static | e_FieldMDPActionExclude |
Flags of form fields (except specified form fields) will be set read-only. More... | |
static | e_FieldMDPActionInclude |
Specified form fields' flags will be set read-only. More... | |
static | e_FieldMDPActionNone |
Enumeration for signature FieldMDP("MDP" means modification detection and prevention) action type. More... | |
static | e_KeyNameContactInfo |
Signature key name: contact information. | |
static | e_KeyNameDN |
Signature key name: distinguish name. | |
static | e_KeyNameLocation |
Signature key name: location. | |
static | e_KeyNameProducer |
Signature key name: producer content. | |
static | e_KeyNameReason |
Signature key name: reason. | |
static | e_KeyNameSigner |
Enumeration for signature key name. More... | |
static | e_KeyNameText |
Signature key name: text content. | |
static | e_LabelNameDN |
Signature key name for distinguish name. More... | |
static | e_LabelNameLocation |
Signature label name for location. More... | |
static | e_LabelNameProducer |
Signature key name for producer name. More... | |
static | e_LabelNameReason |
Signature label name for reason. More... | |
static | e_LabelNameSigner |
Enumeration for signature label name. More... | |
static | e_LabelNameSignTime |
Signature label name for sign time. More... | |
static | e_PAdESLevelBB |
PAdES level: B-B. | |
static | e_PAdESLevelBLT |
PAdES level: B-LT. | |
static | e_PAdESLevelBLTA |
PAdES level: B-LTA. | |
static | e_PAdESLevelBT |
PAdES level: B-T. | |
static | e_PAdESLevelNone |
PAdES level: none. | |
static | e_PAdESLevelNotPAdES |
Enumeration for PAdES level. More... | |
static | e_SignatureTypeOrdinary |
Enumeration for signature type. More... | |
static | e_SignatureTypePagingSeal |
Signature type: paging seal. | |
static | e_SignatureTypeTimeStamp |
Signature type: time stamp. | |
static | e_StateCertCannotGetVRI |
Cannot get verify relevant information. | |
static | e_StateNoSignData |
Signature does not have any data for signing.It means that there is not "V" entry in the signature dictionary. | |
static | e_StateSigned |
Signed signature. | |
static | e_StateUnknown |
Enumeration for signature states. More... | |
static | e_StateUnsigned |
Unsigned signature. | |
static | e_StateVerifyChange |
The document has been changed within the scope of the signature. (This indicates that signature is invalid.) | |
static | e_StateVerifyChangeIllegal |
The document has been changed outside of signature scope, and the changed invalidate the signature. | |
static | e_StateVerifyChangeLegal |
The document has been changed outside of signature scope, but the changed is permitted. | |
static | e_StateVerifyErrorByteRange |
Non expected byte range. | |
static | e_StateVerifyErrorData |
Signature data is destroyed (that means the signature data cannot be parsed properly). | |
static | e_StateVerifyIncredible |
Signature cannot be trusted (containing aggression). | |
static | e_StateVerifyInvalid |
Verification state of a signature is invalid. | |
static | e_StateVerifyIssueCurrent |
The verified issue is current issuer. | |
static | e_StateVerifyIssueExpire |
Certificate for verifying issuer is expired. | |
static | e_StateVerifyIssueRevoke |
Certificate for verifying issuer is revoked. | |
static | e_StateVerifyIssueUncheck |
Not check the issuer. | |
static | e_StateVerifyIssueUnknown |
Verification state of the issuer is unknown. | |
static | e_StateVerifyIssueValid |
Verification state of the issuer is valid. | |
static | e_StateVerifyNoChange |
The document has not been changed within the scope of the signature. | |
static | e_StateVerifyTimestampDoc |
The signature is a time stamp signature. | |
static | e_StateVerifyTimestampExpire |
Verification state of the time stamp is expired. | |
static | e_StateVerifyTimestampInvalid |
Verification state of the time stamp is invalid. | |
static | e_StateVerifyTimestampIssueUnknown |
Verification state of the time stamp issuer is unknown. | |
static | e_StateVerifyTimestampIssueValid |
Verification state of the time stamp issuer is valid. | |
static | e_StateVerifyTimestampNone |
No time stamp or not check time stamp. | |
static | e_StateVerifyTimestampTimeBefore |
Verification state of the time stamp time is valid, since the times is before the expiration date. | |
static | e_StateVerifyTimestampValid |
Verification state of the time stamp is valid. | |
static | e_StateVerifyValid |
Verification state of a signature is valid. | |
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 FSDK.Signature is derived from class FSDK.Field. 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 FSDK.TimeStampServerMgr 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 FSDK.Library.RegisterSignatureCallback.
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.
FSDK.Signature.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 FSDK.LTVVerifier.
FSDK.Signature.constructor | ( | document | , |
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; |
FSDK.Signature.constructor | ( | field | ) |
Constructor, with parent class object.
[in] | field | Parent class object. |
FSDK.Signature.EnableEmbedFont | ( | enable_embed_font | ) |
Enable or disable embed font.
enable_embed_font | A flag indicates that whether to embed font for siganture's text. true means that embed font for siganture's text. false means that not to embed font for siganture's text. |
FSDK.Signature.EnableIncrementalSaveForFirstSigning | ( | enable_incremental_save | ) |
Enable or disable incremental save for first signing. User should call this function before calling function FSDK.Signature.StartSign.
Default: false.
[in] | enable_incremental_save | A flag indicates that whether to use incremental save for first signing. true means that use incremental save for first signing. false means that use default save for first signing. |
FSDK.Signature.GenerateAppearance | ( | ) |
Generate the appearance of unsigned signature.
This function is used to display the unsigned ordinary signature on page without calling the function FSDK.Signature.StartSign.
FSDK.Signature.GetAppearanceFlags | ( | ) |
Get signature appearance flags.
Signature appearance flags indicate which information will be shown. Currently, this is only useful after FSDK.Signature.SetAppearanceFlags is set successfully. For a signature gotten from PDF document, the return value of this function would be useless.
FSDK.Signature.GetBitmap | ( | ) |
Get a bitmap which is used for the signature appearance.
FSDK.Signature.GetByteRangeArray | ( | out_byte_range_array: | [number, number, number, number] | ) |
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.
[out] | out_byte_range_array | Output parameter that receives data of byte ranges. Please ensure this array can contain 4 elements. |
FSDK.Signature.GetCert | ( | 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 FSDK.Signature.GetCertCount. |
FSDK.Signature.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 FSDK.Signature.GetCert to get verified public certificate before verifying signature.
FSDK.Signature.GetCertificateInfo | ( | 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:
|
FSDK.Signature.GetDocPermission | ( | ) |
Get document permission for current signature.
FSDK.Signature.GetDocument | ( | ) |
Get the PDF document, which current signature belongs to.
FSDK.Signature.GetFieldMDPAction | ( | ) |
Get FieldMDP("MDP" means modification detection and prevention) action type.
FSDK.Signature.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 FSDK.Signature.GetFieldMDPAction):
FSDK.Signature.GetFilter | ( | ) |
Get filter.
Filter and sub filter are used to specify which registered signature callback object will be used to sign/verify current signature.
FSDK.Signature.GetKeyLabel | ( | 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 FSDK.Signature.e_LabelNameSigner and this should be one of these values. |
FSDK.Signature.GetKeyValue | ( | 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 FSDK.Signature.e_KeyNameSigner and this should be one of these values. |
FSDK.Signature.GetPAdESLevel | ( | ) |
Get PAdES level.
FSDK.Signature.GetPagingSealGroupElements | ( | ) |
Get the group elements of current paging seal signature.
If current signature type is FSDK.Signature.e_SignatureTypePagingSeal, this function will return the array of signature associated with current signature. Otherwise, an empty array will be returned.
FSDK.Signature.GetPagingSealSignature | ( | ) |
Get the paging seal signature.
If current signature type is FSDK.Signature.e_SignatureTypePagingSeal, this function will return the paging seal signature object associated with current signature.
FSDK.Signature.GetSignatureDict | ( | ) |
Get signature dictionary.
Signature dictionary is a part of signature field dictionary.
FSDK.Signature.GetSignatureType | ( | ) |
Get signature type.
FSDK.Signature.GetSignedVersionDocument | ( | 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. |
FSDK.Signature.GetSignTime | ( | ) |
Get time of signing.
FSDK.Signature.GetState | ( | ) |
Get current state.
FSDK.Signature.GetSubFilter | ( | ) |
Get sub filter.
Filter and sub filter are used to specify which registered signature callback object will be used to sign/verify current signature.
FSDK.Signature.IsEmpty | ( | ) |
Check whether current object is empty or not.
When the current object is empty, that means current object is useless.
FSDK.Signature.IsSigned | ( | ) |
Check whether current signature is signed or not.
FSDK.Signature.IsTimeStamp | ( | ) |
Check if current signature is a time stamp signature.
FSDK.Signature.SetAppearanceContent | ( | 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 FSDK.Signature.StartSign 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 FSDK.Signature.SetAppearanceFlags will be ignored and related informations will not be used in appearance – these information are set by: FSDK.Signature.SetSignTime, FSDK.Signature.SetKeyValue (except filter and sub-filter), FSDK.Signature.SetBitmap, FSDK.Signature.SetImage.
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. |
FSDK.Signature.SetAppearanceFlags | ( | appearance_flags | ) |
Set signature appearance flags.
This function is recommended to be used before calling function FSDK.Signature.StartSign for an unsigned signature.
Signature appearance flags indicate which information will be shown in the signed appearance. If customized appearance content has been set by function FSDK.Signature.SetAppearanceContent, appearance flags will be ignored.
If current signature is a time stamp signature, this function will do nothing.
[in] | appearance_flags | Signature appearance flags. Please refer to values starting from FSDK.Signature.e_APFlagFoxitFlag and this should be one or a combination of these values. |
FSDK.Signature.SetBitmap | ( | bitmap | ) |
Set a bitmap for the signature appearance.
This function is recommended to be used before calling function FSDK.Signature.StartSign for an unsigned signature. If customized appearance content has been set by function FSDK.Signature.SetAppearanceContent, the bitmap will not be used in signed appearance.
If current signature is a time stamp signature, this function will do nothing.
[in] | bitmap | A bitmap to be set to the appearance. It should be valid. |
FSDK.Signature.SetCertChain | ( | 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. |
FSDK.Signature.SetCustomObject | ( | key | , |
pdf_object | |||
) |
Set custom PDF object for signature dictionary.
This function is recommended to be used before calling function FSDK.Signature.StartSign 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 FSDK.PDFObject object to be set as the key's value. It should not be null. It can be a direct PDF object or an indirect PDF object. |
FSDK.Signature.SetDefaultContentsLength | ( | 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 FSDK.Signature.StartSign 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 FSDK.SignatureCallback.Sign 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. |
FSDK.Signature.SetDocPermission | ( | permission | ) |
Set document permission for current signature.
This function is only useful for an unsigned signature. If this function is used for a signed signature, nothing will be done.
Some notes about the permission value:
[in] | permission | The document permission. Please refer to values starting from FSDK.Signature.e_DocPermUnrestricted and this should be one of these values. |
FSDK.Signature.SetFieldMDPActionFields | ( | action | , |
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 FSDK.Signature.e_FieldMDPActionNone and this should be one of these values.
|
[in] | field_array | A field name array used for FieldMDP action. |
FSDK.Signature.SetFilter | ( | filter | ) |
Set filter.
Filter and sub filter are used to specify which registered signature callback object will be used to sign/verify current signature. User could should set filter and sub filter to use default signature callback in Foxit PDF SDK, or use other filter and sub fitler but please ensure that a signature callback object with non-default filter and sub filter should has been registered in Foxit PDF SDK before signing or verifying current signature. Filter and sub filter for default signature callback are:
[in] | filter | String for filter. It cannot be an empty string. |
FSDK.Signature.SetImage | ( | file_path | , |
frame_index | |||
) |
Set an image for the signature appearance, with a specified frame index.
This function is recommended to be used before calling function FSDK.Signature.StartSign for an unsigned signature. If customized appearance content has been set by function FSDK.Signature.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 FSDK.Image.GetFrameCount of input image file. |
FSDK.Signature.SetImage | ( | image | , |
frame_index | |||
) |
Set an image for the signature appearance, with a specified frame index.
This function is recommended to be used before calling function FSDK.Signature.StartSign for an unsigned signature. If customized appearance content has been set by function FSDK.Signature.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 FSDK.Image.e_Unknown. |
[in] | frame_index | Frame index. Valid range: from 0 to (count-1). count is returned by function FSDK.Image.GetFrameCount. |
FSDK.Signature.SetKeyLabel | ( | label_name | , |
label_value | |||
) |
Set the string for specified key label.
This function is recommended to be used before calling function FSDK.Signature.StartSign 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 FSDK.Signature.e_LabelNameSigner 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 FSDK.Signature.e_LabelNameSigner 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 FSDK.Signature.e_LabelNameSigner for more details. |
FSDK.Signature.SetKeyValue | ( | key | , |
value | |||
) |
Set the string value for specified key name.
This function is recommended to be used before calling function FSDK.Signature.StartSign 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 FSDK.Signature.e_KeyNameSigner and this should be one of these values. |
[in] | value | New string value. |
FSDK.Signature.SetSignTime | ( | sign_time | ) |
Set time of signing.
This function is recommended to be used before calling function FSDK.Signature.StartSign for an unsigned signature.
[in] | sign_time | The signing time. |
FSDK.Signature.SetSubFilter | ( | sub_filter | ) |
Set sub filter.
Filter and sub filter are used to specify which registered signature callback object will be used to sign/verify current signature. User could should set filter and sub filter to use default signature callback in Foxit PDF SDK, or use other filter and sub fitler but please ensure that a signature callback object with non-default filter and sub filter should has been registered in Foxit PDF SDK before signing or verifying current signature. Filter and sub filter for default signature callback are:
[in] | sub_filter | String for sub filter. |
FSDK.Signature.StartSign | ( | cert_file_stream | , |
cert_password | , | ||
digest_algorithm | , | ||
save_path | , | ||
client_data | , | ||
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 FSDK.TimeStampServerMgr 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 FSDK.Library.RegisterSignatureCallback.
For PDF documents that are compliant with PDF/A specification, FSDK.Library.SetDefaultICCProfilesPath is recommended to be called and enable embeding font by calling FSDK.Signature.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 FSDK.StreamCallback object which is implemented by user to access content of a certificate file which will be used for signing. This can be null 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 FSDK.Signature.e_DigestSHA1 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 FSDK.SignatureCallback. This is useless if the default callback object will be used to sign current signature. Default value: null. |
[in] | pause | Pause object which decides if the signing process needs to be paused. This can be null which means not to pause during the signing process. If this is not null, it should be a valid pause object implemented by user. Default value: null. |
FSDK.Signature.StartSign | ( | cert_path | , |
cert_password | , | ||
digest_algorithm | , | ||
save_path | , | ||
client_data | , | ||
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 FSDK.TimeStampServerMgr 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 FSDK.Library.RegisterSignatureCallback.
For PDF documents that are compliant with PDF/A specification, FSDK.Library.SetDefaultICCProfilesPath is recommended to be called and enable embeding font by calling FSDK.Signature.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 FSDK.Signature.e_DigestSHA1 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 FSDK.SignatureCallback. This is useless if the default callback object will be used to sign current signature. Default value: null. |
[in] | pause | Pause object which decides if the signing process needs to be paused. This can be null which means not to pause during the signing process. If this is not null, it should be a valid pause object implemented by user. Default value: null. |
FSDK.Signature.StartSign | ( | cert_path | , |
cert_password | , | ||
digest_algorithm | , | ||
stream_callback | , | ||
client_data | , | ||
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 FSDK.TimeStampServerMgr 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 FSDK.Library.RegisterSignatureCallback.
For PDF documents that are compliant with PDF/A specification, FSDK.Library.SetDefaultICCProfilesPath is recommended to be called and enable embeding font by calling FSDK.Signature.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 FSDK.Signature.e_DigestSHA1 and this should be one of these values. |
[in] | stream_callback | A FSDK.StreamCallback 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 FSDK.SignatureCallback. This is useless if the default callback object will be used to sign current signature. Default value: null. |
[in] | pause | Pause object which decides if the signing process needs to be paused. This can be null which means not to pause during the signing process. If this is not null, it should be a valid pause object implemented by user. Default value: null. |
FSDK.Signature.StartVerify | ( | client_data | , |
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 FSDK.Library.RegisterSignatureCallback. 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 FSDK.LTVVerifier.
[in] | client_data | A user-defined object, which will be passed to call back functions in FSDK.SignatureCallback. This is useless if the default callback object will be used to verify current signature. Default value: null. |
[in] | pause | Pause object which decides if the verifying process needs to be paused. This can be null which means not to pause during the verifying process. If this is not null, it should be a valid pause object implemented by user. Default value: null. |
|
static |
Enumeration for signature appearance flags.
Values of this enumeration can be used alone or in combination.
If set, show Foxit flag on signature appearance.
|
static |
Enumeration for signature digest algorithm.
Values of this enumeration should be used alone.
Signature digest algorithm: sha1 algorithm.
|
static |
Enumeration for signature document permission.
Values of this enumeration should be used alone.
No restriction.
|
static |
Flags of form fields (except specified form fields) will be set read-only.
|
static |
Specified form fields' flags will be set read-only.
|
static |
Enumeration for signature FieldMDP("MDP" means modification detection and prevention) action type.
Values of this enumeration should be used alone.
No Field MDP action.
|
static |
Enumeration for signature key name.
Values of this enumeration should be used alone.
Signature key name: signer.
|
static |
Signature key name for distinguish name.
|
static |
Signature label name for location.
|
static |
Signature key name for producer name.
|
static |
Signature label name for reason.
|
static |
Enumeration for signature label name.
Values of this enumeration should be used alone.
Signature label name for signer.
|
static |
Signature label name for sign time.
|
static |
Enumeration for PAdES level.
Values of this enumeration should be used alone.
Not a PAdES signature.
|
static |
Enumeration for signature type.
Values of this enumeration should be used alone.
Signature type: ordinary.
|
static |
Enumeration for signature states.
Values of this enumeration can be used alone or in combination.
These values can be divided into four parts:
Unknown signature.