ipdf_sign.h
签名:数字签名的创建与校验。
インターフェースの説明はヘッダーの英語原文のままにしています。読んでいるコードと突き合わせやすくするためです。
定数
| シグネチャ | Value | Description |
|---|---|---|
| SIGN_NAME_SHOW_NONE | 0 | — |
| SIGN_NAME_SHOW_IMAGE | 1 | — |
| SIGN_NAME_SHOW_COMMONNAME | 2 | — |
| SIGN_SHOW_DETAIL_LEFT | 0 | — |
| SIGN_SHOW_DETAIL_RIGHT | 1 | — |
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.