Foxit PDF SDK
|
Public Member Functions | |
Signature (const interform::Field &field) | |
Constructor, with parent class object. More... | |
Signature (const foxit::pdf::PDFDoc &document, foxit::pdf::objects::PDFDictionary *sig_field_dict) | |
Constructor, from signature field dictionary. More... | |
~Signature () | |
Destructor. | |
bool | ClearSignedData () |
Clear the data and appearance if current signature is singed and verified valid. More... | |
uint32 | GetAppearanceFlags () |
Get signature appearance flags. More... | |
common::Bitmap | GetBitmap () |
Get a bitmap which is used for the signature appearance. More... | |
bool | GetByteRangeArray (uint32 out_byte_range_array[4]) |
Get the byte ranges data, including 4 elements. More... | |
WString | GetCert (int32 index) const |
Get a certificate from current signature's certificate chain by index. More... | |
int32 | GetCertCount () const |
Get the count of certificates in current signature's certificate chain. More... | |
String | GetCertificateInfo (const char *key) |
Get certificate information. More... | |
PDFDoc | GetDocument () |
Get the PDF document, which current signature belongs to. More... | |
String | GetFilter () |
Get filter. More... | |
WString | GetKeyValue (KeyName key) |
Get the string value for specified key name. More... | |
PAdESLevel | GetPAdESLevel () |
Get PAdES level. More... | |
objects::PDFDictionary * | GetSignatureDict () const |
Get signature dictionary. More... | |
SignatureType | GetSignatureType () |
Get signature type. More... | |
PDFDoc | GetSignedVersionDocument (const wchar_t *file_path) |
Get the PDF document in the signed version in which current signature was signed. More... | |
DateTime | GetSignTime () |
Get time of signing. More... | |
uint32 | GetState () |
Get current state. More... | |
String | GetSubFilter () |
Get sub filter. More... | |
bool | IsEmpty () const |
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 (const String &appearance_content) |
Set customized appearance content (as low level drawing operation commands) for signed signature appearance. More... | |
void | SetAppearanceFlags (uint32 appearance_flags) |
Set signature appearance flags. More... | |
void | SetBitmap (const common::Bitmap &bitmap) |
Set a bitmap for the signature appearance. More... | |
void | SetCertChain (const WStringArray &cert_chain) |
Set a certificate chain. More... | |
void | SetDefaultContentsLength (uint32 default_length) |
Set the default length of signature contents which represents signature value (known as signed data). More... | |
void | SetFilter (const char *filter) |
Set filter. More... | |
void | SetImage (const common::Image &image, int frame_index) |
Set an image for the signature appearance, with a specified frame index. More... | |
void | SetImage (const char *file_path, int frame_index) |
Set an image for the signature appearance, with a specified frame index. More... | |
void | SetImage (const wchar_t *file_path, int frame_index) |
Set an image for the signature appearance, with a specified frame index. More... | |
void | SetKeyValue (KeyName key, const wchar_t *value) |
Set the string value for specified key name. More... | |
void | SetSignTime (const DateTime &sign_time) |
Set time of signing. More... | |
void | SetSubFilter (const char *sub_filter) |
Set sub filter. More... | |
common::Progressive | StartSign (const wchar_t *cert_path, const WString &cert_password, DigestAlgorithm digest_algorithm, const char *save_path, const void *client_data=0, common::PauseCallback *pause=0) |
Start signing current signature if current signature is unsigned. More... | |
common::Progressive | StartSign (foxit::common::file::StreamCallback *cert_file_stream, const WString &cert_password, DigestAlgorithm digest_algorithm, const char *save_path, const void *client_data=0, common::PauseCallback *pause=0) |
Start signing current signature if current signature is unsigned. More... | |
common::Progressive | StartSign (const wchar_t *cert_path, const WString &cert_password, DigestAlgorithm digest_algorithm, const wchar_t *save_path, const void *client_data=0, common::PauseCallback *pause=0) |
Start signing current signature if current signature is unsigned. More... | |
common::Progressive | StartSign (foxit::common::file::StreamCallback *cert_file_stream, const WString &cert_password, DigestAlgorithm digest_algorithm, const wchar_t *save_path, const void *client_data=0, common::PauseCallback *pause=0) |
Start signing current signature if current signature is unsigned. More... | |
common::Progressive | StartSign (const wchar_t *cert_path, const foxit::WString &cert_password, foxit::pdf::Signature::DigestAlgorithm digest_algorithm, foxit::common::file::StreamCallback *stream_callback, const void *client_data=0, foxit::common::PauseCallback *pause=0) |
Start signing current signature if current signature is unsigned. More... | |
common::Progressive | StartSign (foxit::common::file::StreamCallback *cert_file_stream, const foxit::WString &cert_password, foxit::pdf::Signature::DigestAlgorithm digest_algorithm, foxit::common::file::StreamCallback *stream_callback, const void *client_data=0, foxit::common::PauseCallback *pause=0) |
Start signing current signature if current signature is unsigned. More... | |
common::Progressive | StartVerify (const void *client_data=0, common::PauseCallback *pause=0) |
Start verifying the intergrity of current signature if current signature is signed. More... | |
![]() | |
Field (const PDFDoc &document, objects::PDFDictionary *field_dict) | |
Constructor, from field dictionary. More... | |
Field (const Field &field) | |
Constructor, with another form field object. More... | |
~Field () | |
Destructor. | |
common::Alignment | GetAlignment () const |
Get the alignment value. More... | |
WString | GetAlternateName () const |
Get alternate name. More... | |
Control | GetControl (int index) |
Get a form control by index. More... | |
Control | GetControl (const foxit::pdf::PDFPage &page, int index) |
Get a form control by index, in a specified PDF page. More... | |
int | GetControlCount () const |
Get count of form controls. More... | |
int | GetControlCount (const foxit::pdf::PDFPage &page) const |
Get count of form controls in a specified PDF page. More... | |
DefaultAppearance | GetDefaultAppearance () const |
Get the default appearance data. More... | |
WString | GetDefaultValue () const |
Get default value. More... | |
objects::PDFObject * | GetDefaultValueObj () const |
Get the PDF object of field's default value. More... | |
objects::PDFDictionary * | GetDict () const |
Get the PDF dictionary of current object. More... | |
uint32 | GetFlags () const |
Get field flags. More... | |
objects::PDFObject * | GetInheritedAttribute (const char *attribute_name) const |
Get the PDF object for specified attribute which may be inherited from the ancestor node in the field tree. More... | |
WString | GetMappingName () const |
Get mapping name. More... | |
int | GetMaxLength () const |
Get maximum length of the field's text, in characters. More... | |
WString | GetName () const |
Get field name. More... | |
ChoiceOptionArray | GetOptions () const |
Get options of list box or combo box. More... | |
int | GetTopVisibleIndex () |
Get top index of option for scrollable list boxes. More... | |
Type | GetType () const |
Get field type. More... | |
WString | GetValue () const |
Get value. More... | |
objects::PDFObject * | GetValueObj () const |
Get the PDF object of field's value. More... | |
bool | IsEmpty () const |
Check whether current object is empty or not. More... | |
bool | operator!= (const Field &other) const |
Not equal operator. More... | |
Field & | operator= (const Field &other) |
Assign operator. More... | |
bool | operator== (const Field &other) const |
Equal operator. More... | |
bool | Reset () |
Reset data in current field to its default value. (Not support signature field) More... | |
void | SetAlignment (common::Alignment alignment) |
Set alignment property of a form, as a document-wide default value. (Not support signature field) More... | |
void | SetAlternateName (const wchar_t *alternate_name) |
Set alternate name. (Not support signature field) More... | |
void | SetDefaultAppearance (const DefaultAppearance &default_ap) |
Set default appearance data. More... | |
void | SetDefaultValue (const wchar_t *value) |
Set default value. More... | |
void | SetFlags (uint32 flags) |
Set field flags. More... | |
void | SetMappingName (const wchar_t *name) |
Set mapping name. (Not support signature field) More... | |
void | SetMaxLength (int max_length) |
Set maximum length of the field's text, in characters. More... | |
void | SetOptions (const ChoiceOptionArray &option_array) |
Set options of list box or combo box. More... | |
void | SetTopVisibleIndex (int index) |
Set top index for scrollable list boxes. More... | |
void | SetValue (const wchar_t *value) |
Set value. More... | |
![]() | |
FS_HANDLE | Handle () const |
Get the handle of current object. 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 Signature is derived from class interform::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 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 common::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.
Enumeration for signature appearance flags.
Values of this enumeration can be used alone or in combination.
Enumeration for signature digest algorithm.
Values of this enumeration should be used alone.
Enumeration for signature key name.
Values of this enumeration should be used alone.
Enumeration for PAdES level.
Values of this enumeration should be used alone.
Enumeration for signature states.
Values of this enumeration can be used alone or in combination.
These values can be divided into four parts:
|
explicit |
Constructor, with parent class object.
[in] | field | Parent class object. |
foxit::pdf::Signature::Signature | ( | const foxit::pdf::PDFDoc & | document, |
foxit::pdf::objects::PDFDictionary * | 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; |
bool foxit::pdf::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 LTVVerifier.
uint32 foxit::pdf::Signature::GetAppearanceFlags | ( | ) |
Get signature appearance flags.
Signature appearance flags indicate which information will be shown. Currently, this is only useful after Signature::SetAppearanceFlags is set successfully. For a signature gotten from PDF document, the return value of this function would be useless.
common::Bitmap foxit::pdf::Signature::GetBitmap | ( | ) |
Get a bitmap which is used for the signature appearance.
bool foxit::pdf::Signature::GetByteRangeArray | ( | uint32 | out_byte_range_array[4] | ) |
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. |
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 Signature::GetCertCount. |
int32 foxit::pdf::Signature::GetCertCount | ( | ) | const |
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 Signature::GetCert to get verified public certificate before verifying signature.
String foxit::pdf::Signature::GetCertificateInfo | ( | const char * | 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:
|
PDFDoc foxit::pdf::Signature::GetDocument | ( | ) |
Get the PDF document, which current signature belongs to.
String foxit::pdf::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.
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 Signature::e_KeyNameSigner and this should be one of these values. |
PAdESLevel foxit::pdf::Signature::GetPAdESLevel | ( | ) |
Get PAdES level.
objects::PDFDictionary* foxit::pdf::Signature::GetSignatureDict | ( | ) | const |
Get signature dictionary.
Signature dictionary is a part of signature field dictionary.
SignatureType foxit::pdf::Signature::GetSignatureType | ( | ) |
Get signature type.
PDFDoc foxit::pdf::Signature::GetSignedVersionDocument | ( | const wchar_t * | 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. |
DateTime foxit::pdf::Signature::GetSignTime | ( | ) |
Get time of signing.
uint32 foxit::pdf::Signature::GetState | ( | ) |
Get current state.
String foxit::pdf::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.
bool foxit::pdf::Signature::IsEmpty | ( | ) | const |
Check whether current object is empty or not.
When the current object is empty, that means current object is useless.
bool foxit::pdf::Signature::IsSigned | ( | ) |
Check whether current signature is signed or not.
bool foxit::pdf::Signature::IsTimeStamp | ( | ) |
Check if current signature is a time stamp signature.
void foxit::pdf::Signature::SetAppearanceContent | ( | const String & | 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 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 Signature::SetAppearanceFlags will be ignored and related informations will not be used in appearance – these information are set by: Signature::SetSignTime, Signature::SetKeyValue (except filter and sub-filter), Signature::SetBitmap, 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. |
void foxit::pdf::Signature::SetAppearanceFlags | ( | uint32 | appearance_flags | ) |
Set signature appearance flags.
This function is recommended to be used before calling function 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 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 Signature::e_APFlagFoxitFlag and this should be one or a combination of these values. |
void foxit::pdf::Signature::SetBitmap | ( | const common::Bitmap & | bitmap | ) |
Set a bitmap for the signature appearance.
This function is recommended to be used before calling function Signature::StartSign for an unsigned signature. If customized appearance content has been set by function 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. |
void foxit::pdf::Signature::SetCertChain | ( | const WStringArray & | 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 foxit::pdf::Signature::SetDefaultContentsLength | ( | uint32 | 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 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 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. |
void foxit::pdf::Signature::SetFilter | ( | const char * | 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. |
void foxit::pdf::Signature::SetImage | ( | const common::Image & | image, |
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 Signature::StartSign for an unsigned signature. If customized appearance content has been set by function 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 common::Image::e_Unknown. |
[in] | frame_index | Frame index. Valid range: from 0 to (count-1). count is returned by function common::Image::GetFrameCount. |
void foxit::pdf::Signature::SetImage | ( | const char * | file_path, |
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 Signature::StartSign for an unsigned signature. If customized appearance content has been set by function 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 common::Image::GetFrameCount of input image file. |
void foxit::pdf::Signature::SetImage | ( | const wchar_t * | file_path, |
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 Signature::StartSign for an unsigned signature. If customized appearance content has been set by function 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 common::Image::GetFrameCount of input image file. |
void foxit::pdf::Signature::SetKeyValue | ( | KeyName | key, |
const wchar_t * | value | ||
) |
Set the string value for specified key name.
This function is recommended to be used before calling function 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 Signature::e_KeyNameSigner and this should be one of these values. |
[in] | value | New string value. |
void foxit::pdf::Signature::SetSignTime | ( | const DateTime & | sign_time | ) |
Set time of signing.
This function is recommended to be used before calling function Signature::StartSign for an unsigned signature.
[in] | sign_time | The signing time. |
void foxit::pdf::Signature::SetSubFilter | ( | const char * | 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. |
common::Progressive foxit::pdf::Signature::StartSign | ( | const wchar_t * | cert_path, |
const WString & | cert_password, | ||
DigestAlgorithm | digest_algorithm, | ||
const char * | save_path, | ||
const void * | client_data = 0 , |
||
common::PauseCallback * | pause = 0 |
||
) |
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 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 common::Library::RegisterSignatureCallback.
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 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 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. |
common::Progressive foxit::pdf::Signature::StartSign | ( | foxit::common::file::StreamCallback * | cert_file_stream, |
const WString & | cert_password, | ||
DigestAlgorithm | digest_algorithm, | ||
const char * | save_path, | ||
const void * | client_data = 0 , |
||
common::PauseCallback * | pause = 0 |
||
) |
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 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 common::Library::RegisterSignatureCallback.
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 foxit::common::file::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 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 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. |
common::Progressive foxit::pdf::Signature::StartSign | ( | const wchar_t * | cert_path, |
const WString & | cert_password, | ||
DigestAlgorithm | digest_algorithm, | ||
const wchar_t * | save_path, | ||
const void * | client_data = 0 , |
||
common::PauseCallback * | pause = 0 |
||
) |
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 common::Library::RegisterSignatureCallback.
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 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 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. |
common::Progressive foxit::pdf::Signature::StartSign | ( | foxit::common::file::StreamCallback * | cert_file_stream, |
const WString & | cert_password, | ||
DigestAlgorithm | digest_algorithm, | ||
const wchar_t * | save_path, | ||
const void * | client_data = 0 , |
||
common::PauseCallback * | pause = 0 |
||
) |
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 common::Library::RegisterSignatureCallback.
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 foxit::common::file::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 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 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. |
common::Progressive foxit::pdf::Signature::StartSign | ( | const wchar_t * | cert_path, |
const foxit::WString & | cert_password, | ||
foxit::pdf::Signature::DigestAlgorithm | digest_algorithm, | ||
foxit::common::file::StreamCallback * | stream_callback, | ||
const void * | client_data = 0 , |
||
foxit::common::PauseCallback * | pause = 0 |
||
) |
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 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 common::Library::RegisterSignatureCallback.
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 Signature::e_DigestSHA1 and this should be one of these values. |
[in] | stream_callback | A foxit::common::file::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 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. |
common::Progressive foxit::pdf::Signature::StartSign | ( | foxit::common::file::StreamCallback * | cert_file_stream, |
const foxit::WString & | cert_password, | ||
foxit::pdf::Signature::DigestAlgorithm | digest_algorithm, | ||
foxit::common::file::StreamCallback * | stream_callback, | ||
const void * | client_data = 0 , |
||
foxit::common::PauseCallback * | pause = 0 |
||
) |
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 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 common::Library::RegisterSignatureCallback.
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 foxit::common::file::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 Signature::e_DigestSHA1 and this should be one of these values. |
[in] | stream_callback | A foxit::common::file::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 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. |
common::Progressive foxit::pdf::Signature::StartVerify | ( | const void * | client_data = 0 , |
common::PauseCallback * | pause = 0 |
||
) |
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 common::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 LTVVerifier.
[in] | client_data | A user-defined object, which will be passed to call back functions in 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. |