Inherits SystemIDisposable.
|
virtual Progressive.State | ContinueCalcDigest (global::System.IntPtr client_data, PauseCallback pause) |
| A callback function used to continue the custom digest calculation process. More...
|
|
virtual byte [] | GetDigest (global::System.IntPtr client_data) |
| A callback function used to get the digest after the calculation process is finished. More...
|
|
virtual bool | IsNeedPadData () |
| Check whether to return all contents with padding zero or not, when callback function SignatureCallback::VerifySigState is called. More...
|
|
virtual void | Release () |
| A callback function used to release current SignatureCallback object itself. More...
|
|
virtual byte [] | Sign (global::System.IntPtr digest, int digest_length, string cert_path, byte[] cert_password, Signature.DigestAlgorithm digest_algorithm, global::System.IntPtr client_data) |
| A callback function used to do signing and return the signed data. More...
|
|
virtual bool | StartCalcDigest (FileReaderCallback file, System.IntPtr byte_range_array, int size_of_array, Signature signature, global::System.IntPtr client_data) |
| A callback function used to start a custom digest calculation, mainly to initialize the calculation process. More...
|
|
virtual int | VerifySigState (global::System.IntPtr digest, int digest_length, global::System.IntPtr signed_data, int signed_data_len, global::System.IntPtr client_data) |
| A callback function used to do verifying and return the verify state. More...
|
|
This class represent a callback object to sign or verify signature. All the pure virtual functions in this class are used as callback functions and should be implemented by user, in order to sign or verify signature in a customized way.
User can set register customized signature callback object to Foxit PDF SDK by function common::Library::RegisterSignatureCallback with filter and sub filter as the callback name.
- See also
- common::Library
◆ ContinueCalcDigest()
Progressive.State foxit.pdf.SignatureCallback.ContinueCalcDigest |
( |
global::System.IntPtr |
client_data, |
|
|
PauseCallback |
pause |
|
) |
| |
|
inlinevirtual |
A callback function used to continue the custom digest calculation process.
- Parameters
-
pause | Pause object which decides if the calculation process needs to be paused. If this is null, it means not to pause during the calculation process. If this is not null, please check the the return value of function PauseCallback::NeedToPauseNow and decide when to pause the calculation process.
|
client_data | A user-defined object, which is passed by user from function Signature::StartSign or Signature::StartVerify.
|
- Returns
- e_Finished means the rendering is finished successfully. e_ToBeContinued means the calculation process is not finished yet and callback function SignatureCallback::ContinueCalcDigest would be triggered again to continue the process. e_Error means any error occurs.
◆ GetDigest()
byte[] foxit.pdf.SignatureCallback.GetDigest |
( |
global::System.IntPtr |
client_data | ) |
|
|
inlinevirtual |
A callback function used to get the digest after the calculation process is finished.
This callback function will be triggered when the calculation process is finished successfully.
- Parameters
-
- Returns
- The digest string. If there is any error, please return an empty string.
◆ IsNeedPadData()
bool foxit.pdf.SignatureCallback.IsNeedPadData |
( |
| ) |
|
|
inlinevirtual |
Check whether to return all contents with padding zero or not, when callback function SignatureCallback::VerifySigState is called.
- Returns
- true means to return all data in contents steam (including padding zero), while false means to return contents data without padding zero in stream end.
◆ Release()
void foxit.pdf.SignatureCallback.Release |
( |
| ) |
|
|
inlinevirtual |
A callback function used to release current SignatureCallback object itself.
- Returns
- None.
◆ Sign()
byte[] foxit.pdf.SignatureCallback.Sign |
( |
global::System.IntPtr |
digest, |
|
|
int |
digest_length, |
|
|
string |
cert_path, |
|
|
byte [] |
cert_password, |
|
|
Signature.DigestAlgorithm |
digest_algorithm, |
|
|
global::System.IntPtr |
client_data |
|
) |
| |
|
inlinevirtual |
A callback function used to do signing and return the signed data.
Host application provides this callback function for custom sign mechanism. This callback function would be triggered during the signature signing process.
- Parameters
-
digest | The digest data buffer, for source file buffer to be signed.
|
digest_length | The size of digest data buffer.
|
cert_path | The certificate file path, which will be used for signing.
|
cert_password | The password string, used to open the cert file. If this is an empty string, that means no password is required.
|
digest_algorithm | The algorithm of message digest for signed data. Please refer to e_DigestXXX values and it would be one of these values.
|
client_data | A user-defined object, which is passed by user from function Signature::StartSign or Signature::StartVerify.
|
- Returns
- Signed data. If there is any error, please return an empty string.
The length of returned signed data should be within the default length of signature contents which is 7942 by default or specified by fucntion Signature::SetDefaultContentsLength before signing the unsigned signature.
◆ StartCalcDigest()
bool foxit.pdf.SignatureCallback.StartCalcDigest |
( |
FileReaderCallback |
file, |
|
|
System.IntPtr |
byte_range_array, |
|
|
int |
size_of_array, |
|
|
Signature |
signature, |
|
|
global::System.IntPtr |
client_data |
|
) |
| |
|
inlinevirtual |
A callback function used to start a custom digest calculation, mainly to initialize the calculation process.
- Parameters
-
file | When signing a signature, this represents the source file object to be signed.
When verifying a signature field, this represents the source file object to be verified.
|
byte_range_array | A byte range array of the signed document(not the source document).
Elements in this array always be in pairs of offset-size values in order of: offset,size,offset,size...
|
size_of_array | Count of elements in the byte range array byte_range_array.
|
signature | A signature object.
|
client_data | A user-defined object, which is passed by user from function Signature::StartSign or Signature::StartVerify.
|
- Returns
- true means the calculation process is successfully started and then SignatureCallback::ContinueCalcDigest will be triggered to continue the calculation process. false means fail to start a calculation process.
◆ VerifySigState()
int foxit.pdf.SignatureCallback.VerifySigState |
( |
global::System.IntPtr |
digest, |
|
|
int |
digest_length, |
|
|
global::System.IntPtr |
signed_data, |
|
|
int |
signed_data_len, |
|
|
global::System.IntPtr |
client_data |
|
) |
| |
|
inlinevirtual |
A callback function used to do verifying and return the verify state.
Host application provides this callback function for custom sign mechanism. This callback function would be triggered during the signature verifying process.
- Parameters
-
digest | The digest data buffer, for source file buffer to be verified.
|
digest_length | The size of digest data buffer.
|
signed_data | The signed data buffer.
|
signed_data_len | The size of signed data buffer.
|
client_data | A user-defined object, which is passed by user from function Signature::StartSign or Signature::StartVerify.
|
- Returns
- Verify state. Please refer to e_StateVerifyXXX values and it should be one or a combination of them.