FSPDF_SIGNATUREHANDLER Struct Reference

Structure for Signature Handler. More...

#include <fpdf_signature_r.h>

Public Attributes

FS_LPVOID clientData
 User-defined data. More...
 
FS_RESULT(* StartCalcDigest )(FS_LPVOID clientData, FSPDF_SIGNATURE sig, FSCRT_FILE file, const FS_DWORD *byteRangeArray, FS_DWORD sizeofArray, FS_LPVOID *context)
 Foxit PDF SDK calls this interface to start a custom digest calculation. More...
 
FS_RESULT(* ContinueCalcDigest )(FS_LPVOID clientData, FS_LPVOID context, FSCRT_PAUSEHANDLER *pause)
 Foxit PDF SDK calls this interface to continue a custom digest calculation. More...
 
FS_RESULT(* FinishCalcDigest )(FS_LPVOID clientData, FS_LPVOID context, FSCRT_BSTR *digest)
 Foxit PDF SDK calls this interface to finish the custom digest calculation and get the digest. More...
 
FS_RESULT(* Sign )(FS_LPVOID clientData, FS_LPVOID context, FSPDF_SIGNATURE sig, const FSCRT_BSTR *digest, FSCRT_BSTR *signedData)
 Foxit PDF SDK calls this interface to sign a document. More...
 
FS_RESULT(* Verify )(FS_LPVOID clientData, FS_LPVOID context, FSPDF_SIGNATURE sig, const FSCRT_BSTR *digest, const FSCRT_BSTR *signedData)
 Verify a specified signature. More...
 

Detailed Description

Structure for Signature Handler.

Note
This is a handler and is implemented by caller.
When host application wants to do customize signing and verifying signature fields, this handler should be implemented and function FSPDF_Signature_RegisterHandler should be called to register this handler to Foxit PDF SDK.

Member Data Documentation

FS_LPVOID FSPDF_SIGNATUREHANDLER::clientData

User-defined data.

Note
Caller can use this field to track controls.
FS_RESULT(* FSPDF_SIGNATUREHANDLER::ContinueCalcDigest) (FS_LPVOID clientData, FS_LPVOID context, FSCRT_PAUSEHANDLER *pause)

Foxit PDF SDK calls this interface to continue a custom digest calculation.

Parameters
[in]clientDataPointer to the user-supplied data.
[in]contextPointer to context handle which is created by callback function FSPDF_SIGNATUREHANDLER::StartCalcDigest.
[in]pausePointer to a FSCRT_PAUSEHANDLER structure to determine break state.
If it is NULL or FSCRT_PAUSEHANDLER::NeedPauseNow is NULL, this function will not return until it is over or error occurs.
Returns
FSCRT_ERRCODE_FINISHED for success.
FSCRT_ERRCODE_TOBECONTINUED if the current process is paused, Foxit PDF SDK will call this function again.
FSCRT_ERRCODE_ERROR if any internal running error occurs.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
FS_RESULT(* FSPDF_SIGNATUREHANDLER::FinishCalcDigest) (FS_LPVOID clientData, FS_LPVOID context, FSCRT_BSTR *digest)

Foxit PDF SDK calls this interface to finish the custom digest calculation and get the digest.

Parameters
[in]clientDataPointer to the user-supplied data.
[in]contextPointer to context handle which is created by callback function FSPDF_SIGNATUREHANDLER::StartCalcDigest.
[out]digestPointer to a FSCRT_BSTR that receives the digest. A digest buffer is not required to be an UTF-8 string.
If it is NULL or FSCRT_PAUSEHANDLER::NeedPauseNow is NULL, this function will not return until it is over or error occurs.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_ERROR if any internal running error occurs.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
FS_RESULT(* FSPDF_SIGNATUREHANDLER::Sign) (FS_LPVOID clientData, FS_LPVOID context, FSPDF_SIGNATURE sig, const FSCRT_BSTR *digest, FSCRT_BSTR *signedData)

Foxit PDF SDK calls this interface to sign a document.

Parameters
[in]clientDataPointer to any type data which indicates user-defined data.
[in]contextPointer to context handle which is created by callback function FSPDF_SIGNATUREHANDLER::StartCalcDigest.
[in]sigHandle to a FSPDF_SIGNATURE object returned by function FSPDF_Doc_GetSignature or FSPDF_Signature_Add.
[in]digestPointer to a FSCRT_BSTR structure that indicates the digest of source file buffer to be signed.
[out]signedDataPointer to a FSCRT_BSTR structure that receives the signed data. A signed buffer is not required to be an UTF-8 string.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_ERROR if any internal running error occurs.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
Host application provides this callback method for custom sign mechanism. It is only called when function FSPDF_Signature_StartSign is invoked.
FS_RESULT(* FSPDF_SIGNATUREHANDLER::StartCalcDigest) (FS_LPVOID clientData, FSPDF_SIGNATURE sig, FSCRT_FILE file, const FS_DWORD *byteRangeArray, FS_DWORD sizeofArray, FS_LPVOID *context)

Foxit PDF SDK calls this interface to start a custom digest calculation.

Parameters
[in]clientDataPointer to the user-supplied data.
[in]sigHandle to a FSPDF_SIGNATURE object returned by function FSPDF_Doc_GetSignature or FSPDF_Signature_Add.
[in]fileHandle to a FSCRT_FILE object.
When signing a signature, it is the source file object to be signed.
When verifying a signature field, it is the source file object to be verified.
[in]byteRangeArrayPointer to 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...
[in]sizeofArrayCount of elements in byte range array byteRangeArray.
[out]contextA pointer specifies a context handle. Return NULL if fails.
Returns
FSCRT_ERRCODE_SUCCESS for success.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
FS_RESULT(* FSPDF_SIGNATUREHANDLER::Verify) (FS_LPVOID clientData, FS_LPVOID context, FSPDF_SIGNATURE sig, const FSCRT_BSTR *digest, const FSCRT_BSTR *signedData)

Verify a specified signature.

Parameters
[in]clientDataPointer to any type data which indicates user-defined data.
[in]contextPointer to context handle which is created by callback function FSPDF_SIGNATUREHANDLER::StartCalcDigest.
[in]sigHandle to a FSPDF_SIGNATURE object returned by function FSPDF_Doc_GetSignature or FSPDF_Signature_Add.
[in]digestPointer to a FSCRT_BSTR structure that indicates the digest of source file buffer to be verified.
[in]signedDataPointer to a FSCRT_BSTR structure which indicates the signed data. A signed data buffer is not required to be an UTF-8 string.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_ERROR if any internal running error occurs.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
Host application provides this callback method for custom sign mechanism. It is only called when function FSPDF_Signature_StartVerify is invoked.

The documentation for this struct was generated from the following file:

Foxit Corporation