ArkoPDF
← SDK API 參考

ipdf_sign.h

签名:数字签名的创建与校验。

介面說明保留標頭檔裡的英文原文 —— 照文件寫程式時要能一眼對上程式碼裡的註解。

常數

簽章ValueDescription
SIGN_NAME_SHOW_NONE0—
SIGN_NAME_SHOW_IMAGE1—
SIGN_NAME_SHOW_COMMONNAME2—
SIGN_SHOW_DETAIL_LEFT0—
SIGN_SHOW_DETAIL_RIGHT1—

class IPDF_DigitalSignCallback

方法(2)

簽章說明
EstimateSignedMessageLength(unsigned char* buf_data, unsigned long data_size)—
EncodeSignedData(int nDigestAlg, unsigned char *pData2BSigned, unsigned long …)Make a RSA PKCS#7 SignedData message by the PCCERT_CONTEXT and corresponding private key from MS CAPI Store.
EncodeSignedData
int EncodeSignedData(int nDigestAlg, unsigned char *pData2BSigned, unsigned long ulData2BSignedLen, unsigned char **ppSignedData, unsigned long *pSignedDataLen, bool bIsContentDetached) = 0;

Make a RSA PKCS#7 SignedData message by the PCCERT_CONTEXT and corresponding private key from MS CAPI Store.

參數

  • nDigestAlg(in) — - Digest algorithm : SHA1 : 0, MD5 : 3, SHA256 : 7.
  • pData2BSigned(in) — - A pointer to the buffer of data to be signed.
  • ulData2BSignedLen(in) — - The length of the data to be signed buffer.
  • pSignedData(out) — - A double pointer to the address of the PKCS#7 SingedData buffer, memory allocated by jrsysMSCryptoDll lib.
  • pSignedDataLen(out) — - A pointer to the address of the PKCS#7 SignedData buffer length allocated.
  • bIsContentDetached(in) — - A Boolean value to indicate if the data to be signed is included in the PKCS#7 SignedData message. @retval 0 means success, other for the error reason (Referenced with WinError.h and WinCrypt.h)

class IPDF_Signer

PDF Signer interface.

方法(12)

簽章說明
Release()Release PDF signer.
CreateSignature(const wchar_t* jpg_file, IPDF_Document* doc_signature)Create a signature pdf by jpg pictures.
CreateSignature_UTF8(const char* jpg_file, IPDF_Document* doc_signature)Utf8 versiont for CreateSignature().
PlaceSignature(IPDF_Page* dest_page, float left, float bottom, int width, i…)Place a signature to PDF page.
SetDigtialSignInfo(const wchar_t* signer_name, const wchar_t* location, const w…)—
SetSignerImageOpacity(float opacity)—
SetDigitalSignTextDirect(int direct)—
SetDigitalSignNameStyle(int name_style)—
SetDigitalSignShowDetailLabel(int bShow)—
SetDigitalSignCallback(IPDF_DigitalSignCallback* callback)—
GetDigitalSignaturePreview()—
DoDigitaSign(IPDF_Page* page_tosigned, PDSDK_FloatRect rect, const wchar_…)—
CreateSignature
int CreateSignature(const wchar_t* jpg_file, IPDF_Document* doc_signature) = 0;

Create a signature pdf by jpg pictures.

參數

  • jpg_file(in) — The jpg file path(Unicode).
  • doc_signature(in) — The PDF document use to save the signature picture.

傳回值:1 for success, 0 for failure NOTE: This method just create a pdf document that contain the signature pictures. to add a signature to pdf, use the signature pdf to add to pdf page by calling PlaceSignature().

CreateSignature_UTF8
int CreateSignature_UTF8(const char* jpg_file, IPDF_Document* doc_signature) = 0;

Utf8 versiont for CreateSignature().

參數

  • jpg_file(in) — The jpg file path(UTF8).
  • doc_signature(in) — The PDF document use to save the signature picture.

傳回值:1 for success, 0 for failure NOTE: This method just create a pdf document that contain the signature pictures. to add a signature to pdf, use the signature pdf to add to pdf page by calling PlaceSignature().

PlaceSignature
IPDF_PageObject* PlaceSignature(IPDF_Page* dest_page, float left, float bottom, int width, int height, IPDF_Document* doc_signature) = 0;

Place a signature to PDF page.

參數

  • dest_page(in) — The PDF page to place the signature.
  • left(in) — Left of left-bottom corner.
  • bottom(in) — bottom of left-bottom corner.
  • width(in) — Specified width for signature.
  • height(in) — Specified height for signature.
  • doc_signature(in) — The PDF document created by CreateSignature();

傳回值:An image object.