Foxit PDF SDK

fs_ofdcustomsignature.h
1 #ifndef FS_OFD_CUSTOM_SIGNATURE_H_
2 #define FS_OFD_CUSTOM_SIGNATURE_H_
3
4 #include "common/fs_common.h"
5
11 namespace foxit {
15 namespace ofd {
16 class OFDDoc;
20 namespace ofdseal {
21 class SealSignature;
22 class PublicProperties;
23 class StraddlePosition;
24
26 class SignatureCallback
27 {
28 public:
30 virtual ~SignatureCallback() {}
31
37 virtual String GetProviderName() = 0;
38
45 virtual String GetCompany() = 0;
46
52 virtual String GetVersion() = 0;
53
59 virtual String GetSignatureTime() = 0;
60
69 virtual String Digest(const void* data, int length) = 0;
70
76 virtual String GetDigestMethod() = 0;
77
86 virtual String Sign(const void* data, int length) = 0;
87
93 virtual String GetSignMethod() = 0;
94
100 virtual String GetSeal() = 0;
101
112 virtual bool Verify(const void* data, int length, const void* sign_value, int sign_value_length) = 0;
113 };
114
116 class CustomSignatureDoc FS_FINAL : public Base {
117 public:
124 explicit CustomSignatureDoc(OFDDoc doc, SignatureCallback* callback);
125
127 ~CustomSignatureDoc();
128
134 CustomSignatureDoc(const CustomSignatureDoc& other);
135
143 CustomSignatureDoc& operator = (const CustomSignatureDoc& other);
144
152 bool operator == (const CustomSignatureDoc& other) const;
153
161 bool operator != (const CustomSignatureDoc& other) const;
162
170 bool IsEmpty() const;
171
184 bool SignWithMultiPage(const String& page_scope, const ImagePosition& position, const String& dest_file, const PublicProperties& proterties = PublicProperties());
185
198 bool SignWithMultiPage(const String& page_scope, const ImagePosition& position, const WString& dest_file, const PublicProperties& proterties = PublicProperties());
199
212 bool SignWithMultiPage(const String& page_scope, const ImagePosition& position, foxit::common::file::WriterCallback* file_writer, const PublicProperties& proterties = PublicProperties());
213
225 bool SignWithMultiPage(const foxit::Int32Array& page_index_array, const ImagePosition& position, const String& dest_file, const PublicProperties& proterties = PublicProperties());
226
238 bool SignWithMultiPage(const foxit::Int32Array& page_index_array, const ImagePosition& position, const WString& dest_file, const PublicProperties& proterties = PublicProperties());
239
251 bool SignWithMultiPage(const foxit::Int32Array& page_index_array, const ImagePosition& position, foxit::common::file::WriterCallback* file_writer, const PublicProperties& proterties = PublicProperties());
252
264 bool SignWithStraddle(const StraddlePosition& position, float width, float height, const String& dest_file, const PublicProperties& proterties = PublicProperties());
265
277 bool SignWithStraddle(const StraddlePosition& position, float width, float height, const WString& dest_file, const PublicProperties& proterties = PublicProperties());
278
290 bool SignWithStraddle(const StraddlePosition& position, float width, float height, foxit::common::file::WriterCallback* file_writer, const PublicProperties& proterties = PublicProperties());
291
292 explicit CustomSignatureDoc(FS_HANDLE handle);
293 };
294
296 class CustomVerify FS_FINAL : public Base {
297 public:
303 static bool Verify(Signature signature, SignatureCallback* callback);
304 };
305
306 } // namespace ofdseal
307 } // namespace ofd
308 } // namespace foxit
309
310 #endif // _BUILD_OFDSDK_
foxit::ofd::ofdseal::CustomSignatureDoc::SignWithMultiPage
bool SignWithMultiPage(const String &page_scope, const ImagePosition &position, const String &dest_file, const PublicProperties &proterties=PublicProperties())
在多页相同位置对OFD文档进行自定义签名或签章。
foxit::ofd::ofdseal::CustomVerify
Definition: fs_ofdcustomsignature.h:296
IFX_FileWrite
文件写入接口。
Definition: fx_stream.h:470
foxit::ofd::ofdseal::CustomSignatureDoc::IsEmpty
bool IsEmpty() const
检查当前对象是否为空。
foxit::ofd::ofdseal::SignatureCallback::GetSignatureTime
virtual String GetSignatureTime()=0
获取签名时间。
foxit::ofd::ofdseal::StraddlePosition
Definition: fs_ofdsign.h:139
foxit::ofd::ofdseal::SignatureCallback
Definition: fs_ofdcustomsignature.h:26
foxit::ofd::ofdseal::SignatureCallback::Sign
virtual String Sign(const void *data, int length)=0
对数据进行签名计算。
foxit::ofd::ofdseal::SignatureCallback::Verify
virtual bool Verify(const void *data, int length, const void *sign_value, int sign_value_length)=0
验证签名值。
foxit::ofd::ofdseal::CustomSignatureDoc::SignWithStraddle
bool SignWithStraddle(const StraddlePosition &position, float width, float height, const String &dest_file, const PublicProperties &proterties=PublicProperties())
在跨页位置对OFD文档进行自定义签名或签章，即骑缝章。
CFX_WideString
宽字符串类
Definition: fx_string.h:1457
foxit::ofd::ofdseal::CustomSignatureDoc::~CustomSignatureDoc
~CustomSignatureDoc()
析构函数。
foxit::ofd::ofdseal::CustomSignatureDoc
Definition: fs_ofdcustomsignature.h:116
foxit::ofd::ofdseal::SignatureCallback::GetSeal
virtual String GetSeal()=0
获取印章文件(Seal.esl)内容。
foxit::ofd::ofdseal::Signature
Definition: fs_ofdsignature.h:209
foxit::ofd::ofdseal::CustomSignatureDoc::operator=
CustomSignatureDoc & operator=(const CustomSignatureDoc &other)
赋值操作符。
foxit::ofd::ofdseal::SignatureCallback::Digest
virtual String Digest(const void *data, int length)=0
对数据进行摘要计算。
foxit::ofd::ofdseal::SignatureCallback::GetCompany
virtual String GetCompany()=0
获取签名或签章提供者公司名称。
foxit::ofd::ofdseal::SignatureCallback::GetVersion
virtual String GetVersion()=0
获取签名或签章版本号。
CFX_ArrayTemplate< int32 >
foxit::FS_HANDLE
void * FS_HANDLE
句柄类型。
Definition: fs_basictypes.h:213
fs_common.h
通用定义和类的头文件。
foxit::ofd::ofdseal::CustomSignatureDoc::CustomSignatureDoc
CustomSignatureDoc(OFDDoc doc, SignatureCallback *callback)
带参数的构造函数。
foxit::ofd::OFDDoc
Definition: fs_ofddoc.h:271
foxit::ofd::ofdseal::SignatureCallback::~SignatureCallback
virtual ~SignatureCallback()
Definition: fs_ofdcustomsignature.h:30
foxit::ofd::ofdseal::PublicProperties
Definition: fs_ofdsign.h:269
foxit::Base
Definition: fs_basictypes.h:465
foxit::ofd::ofdseal::SignatureCallback::GetProviderName
virtual String GetProviderName()=0
获取签名或签章提供者名称。
foxit::ofd::ofdseal::SignatureCallback::GetSignMethod
virtual String GetSignMethod()=0
获取签名方法名称。
foxit::ofd::ofdseal::ImagePosition
Definition: fs_ofdsign.h:24
foxit
Foxit命名空间。
Definition: fs_taggedpdf.h:27
CFX_ByteString
字节字符串类
Definition: fx_string.h:317
foxit::ofd::ofdseal::CustomSignatureDoc::operator==
bool operator==(const CustomSignatureDoc &other) const
相等操作符。
foxit::ofd::ofdseal::CustomSignatureDoc::operator !=
bool operator !=(const CustomSignatureDoc &other) const
不相等操作符。
foxit::ofd::ofdseal::SignatureCallback::GetDigestMethod
virtual String GetDigestMethod()=0
获取摘要方法名称。
foxit::ofd::ofdseal::CustomVerify::Verify
static bool Verify(Signature signature, SignatureCallback *callback)