Foxit PDF SDK

fs_ofdsignature.h
1 #ifndef FS_OFD_SIGNATUE_H_
2 #define FS_OFD_SIGNATUE_H_
3
4 #include "common/fs_common.h"
5 #include "common/fs_image.h"
6
12 namespace foxit {
16 namespace ofd {
20 namespace ofdseal {
21 class Oes;
22
24 class OperateSignatureInfo FS_FINAL : public Object {
25 public:
31 typedef enum _SignatureOperationType {
33 e_RemoveInfoOnly = 0,
35 e_ConvertToBlackImage = 1,
37 e_AtomizeImage = 2,
39 e_MosaicImage = 3,
41 e_RemoveAll = 4
42 } SignatureOperationType;
43
44
54 explicit OperateSignatureInfo(SignatureOperationType operation_type = e_RemoveInfoOnly, int atomize_horz_blur = 5, int atomize_vert_blur = 5, int mosaic_vector_length = 5) :
55 operation_type(operation_type),
56 atomize_horz_blur(atomize_horz_blur),
57 atomize_vert_blur(atomize_vert_blur),
58 mosaic_vector_length(mosaic_vector_length) {
59 }
60
66 OperateSignatureInfo(const OperateSignatureInfo& other) {
67 this->operation_type = other.operation_type;
68 this->atomize_horz_blur = other.atomize_horz_blur;
69 this->atomize_vert_blur = other.atomize_vert_blur;
70 this->mosaic_vector_length = other.mosaic_vector_length;
71 }
72
80 OperateSignatureInfo& operator=(const OperateSignatureInfo& other) {
81 this->operation_type = other.operation_type;
82 this->atomize_horz_blur = other.atomize_horz_blur;
83 this->atomize_vert_blur = other.atomize_vert_blur;
84 this->mosaic_vector_length = other.mosaic_vector_length;
85 return *this;
86 }
87
99 void Set(SignatureOperationType operation_type, int atomize_horz_blur, int atomize_vert_blur, int mosaic_vector_length) {
100 this->operation_type = operation_type;
101 this->atomize_horz_blur = atomize_horz_blur;
102 this->atomize_vert_blur = atomize_vert_blur;
103 this->mosaic_vector_length = mosaic_vector_length;
104 }
105
111 SignatureOperationType operation_type;
112
117 int atomize_horz_blur;
118
123 int atomize_vert_blur;
124
129 int mosaic_vector_length;
130 };
131
133 class VerifyExtendInfo FS_FINAL : public Object
134 {
135 public:
143 explicit VerifyExtendInfo(const String& application_name = "", const String& user_login = "", const String& file_name = "") :
144 application_name(application_name),
145 user_login(user_login),
146 file_name(file_name) {
147 }
148
154 VerifyExtendInfo(const VerifyExtendInfo& other) :
155 application_name(other.application_name),
156 user_login(other.user_login),
157 file_name(other.file_name) {
158 }
159
167 VerifyExtendInfo& operator=(const VerifyExtendInfo& other) {
168 this->application_name = other.application_name;
169 this->user_login = other.user_login;
170 this->file_name = other.file_name;
171 return *this;
172 }
173
183 void Set(const String& application_name, const String& user_login, const String& file_name) {
184 this->application_name = application_name;
185 this->user_login = user_login;
186 this->file_name = file_name;
187 }
188
193 String application_name;
194
199 String user_login;
200
205 String file_name;
206 };
207
209 class Signature : public Base {
210 public:
216 typedef enum _SignatureType {
218 e_SignatureTypeDefault = 0,
220 e_SignatureTypeSeal = 1,
222 e_SignatureTypeSign = 2,
224 e_SignatureTypeTimeStamp = 3
225 } SignatureType;
226
228 ~Signature();
229
235 Signature(const Signature& other);
236
244 Signature& operator = (const Signature& other);
245
253 bool operator == (const Signature& other) const;
254
262 bool operator != (const Signature& other) const;
263
271 bool IsEmpty() const;
272
279 SignatureType GetType();
280
286 WString GetProviderName();
287
293 WString GetCompany();
294
300 WString GetVersion();
301
307 WString GetDigestMethod();
308
314 WString GetSignMethod();
315
321 WString GetVerifyMessage();
322
330 bool Operate(const foxit::ofd::ofdseal::OperateSignatureInfo& info);
331
332 explicit Signature(FS_HANDLE handle);
333 };
334
336 class SealSignature FS_FINAL : public Signature {
337 public:
343 explicit SealSignature(Signature object);
344
346 ~SealSignature();
347
353 SealSignature(const SealSignature& other);
354
362 SealSignature& operator = (const SealSignature& other);
363
371 bool operator == (const SealSignature& other) const;
372
380 bool operator != (const SealSignature& other) const;
381
389 bool IsEmpty() const;
390
396 WString GetSealId();
397
403 WString GetSealVersion();
404
410 WString GetSealVenderId();
411
417 WString GetSealType();
418
424 WString GetSealName();
425
431 String GetSealSignerCertInfo();
432
438 WString GetSealValidStartTime();
439
445 WString GetSealValidEndTime();
451 WString GetSealSignedDate();
452
458 WString GetSealSignMethod();
459
465 foxit::common::Bitmap GetImage();
466
475 bool Verify(bool online = false);
476
486 bool VerifyWithOes(const Oes& oes, bool online = false);
487
496 bool VerifyWithoutOes(bool online = false);
497
507 bool VerifyEx(const foxit::ofd::ofdseal::VerifyExtendInfo& extend_info, bool online = false);
508
516 bool ExportPublicCertificateFile(const String& file_path);
517
525 bool ExportPublicCertificateFile(const WString& file_path);
526
534 bool ExportPublicCertificateFile(foxit::common::file::WriterCallback* writer_callback);
535
536 explicit SealSignature(FS_HANDLE handle);
537 };
538
540 class SignSignature FS_FINAL : public Signature {
541 public:
547 explicit SignSignature(Signature object);
548
550 ~SignSignature();
551
557 SignSignature(const SignSignature& other);
558
566 SignSignature& operator = (const SignSignature& other);
567
575 bool operator == (const SignSignature& other) const;
576
584 bool operator != (const SignSignature& other) const;
585
593 bool IsEmpty() const;
594
600 foxit::common::Bitmap GetImage();
601
607 bool Verify();
608
616 bool ExportPublicCertificateFile(const String& file_path);
617
618 explicit SignSignature(FS_HANDLE handle);
619 };
620
621 } // namespace ofdseal
622 } // namespace ofd
623 } // namespace foxit
624
625 #endif // _BUILD_OFDSDK_
foxit::ofd::ofdseal::Signature::Operate
bool Operate(const foxit::ofd::ofdseal::OperateSignatureInfo &info)
对OFD文档内的签名或签章进行操作。
foxit::ofd::ofdseal::SignSignature
Definition: fs_ofdsignature.h:540
IFX_FileWrite
文件写入接口。
Definition: fx_stream.h:470
foxit::ofd::ofdseal::Signature::operator==
bool operator==(const Signature &other) const
相等操作符。
foxit::common::Bitmap
Definition: fs_image.h:36
foxit::ofd::ofdseal::OperateSignatureInfo::mosaic_vector_length
int mosaic_vector_length
马赛克向量长度。operation_type为e_MosaicImage时起作用。
Definition: fs_ofdsignature.h:129
foxit::ofd::ofdseal::OperateSignatureInfo::atomize_vert_blur
int atomize_vert_blur
纵向高斯模糊。operation_type为e_AtomizeImage时起作用。
Definition: fs_ofdsignature.h:123
foxit::Object
CFX_Object Object
对象类型。
Definition: fs_basictypes.h:220
foxit::ofd::ofdseal::SignSignature::operator==
bool operator==(const SignSignature &other) const
相等操作符。
foxit::ofd::ofdseal::SignSignature::operator !=
bool operator !=(const SignSignature &other) const
不相等操作符。
foxit::ofd::ofdseal::SignSignature::ExportPublicCertificateFile
bool ExportPublicCertificateFile(const String &file_path)
导出公钥证书文件。
foxit::ofd::ofdseal::OperateSignatureInfo::operation_type
SignatureOperationType operation_type
签章操作类型。请参考从 foxit::ofd::ofdseal::OperateSignatureInfo::e_RemoveInfoOnly 开始的值， 这应该是这些值中的一个。
Definition: fs_ofdsignature.h:111
foxit::ofd::ofdseal::Signature::GetVersion
WString GetVersion()
获取签名或签章版本。
foxit::ofd::ofdseal::SealSignature::VerifyEx
bool VerifyEx(const foxit::ofd::ofdseal::VerifyExtendInfo &extend_info, bool online=false)
使用扩展信息验证签章的有效性。
foxit::ofd::ofdseal::VerifyExtendInfo::operator=
VerifyExtendInfo & operator=(const VerifyExtendInfo &other)
赋值操作符。
Definition: fs_ofdsignature.h:167
foxit::ofd::ofdseal::SealSignature::GetSealVersion
WString GetSealVersion()
获取电子印章版本。
foxit::ofd::ofdseal::Oes
Definition: fs_ofdoesseal.h:143
foxit::ofd::ofdseal::Signature::e_SignatureTypeSeal
电子签章.。
Definition: fs_ofdsignature.h:220
CFX_WideString
宽字符串类
Definition: fx_string.h:1457
foxit::ofd::ofdseal::VerifyExtendInfo::VerifyExtendInfo
VerifyExtendInfo(const String &application_name="", const String &user_login="", const String &file_name="")
带参数的构造函数。
Definition: fs_ofdsignature.h:143
foxit::ofd::ofdseal::SealSignature::Verify
bool Verify(bool online=false)
验证签章的有效性。
foxit::ofd::ofdseal::SealSignature::operator !=
bool operator !=(const SealSignature &other) const
不相等操作符。
foxit::ofd::ofdseal::SealSignature
Definition: fs_ofdsignature.h:336
foxit::ofd::ofdseal::OperateSignatureInfo::atomize_horz_blur
int atomize_horz_blur
横向高斯模糊。operation_type为e_AtomizeImage时起作用。
Definition: fs_ofdsignature.h:117
foxit::ofd::ofdseal::SealSignature::GetSealSignerCertInfo
String GetSealSignerCertInfo()
获取电子印章签章者证书信息。
foxit::ofd::ofdseal::OperateSignatureInfo::OperateSignatureInfo
OperateSignatureInfo(const OperateSignatureInfo &other)
构造函数，通过另一个操作签名信息对象。
Definition: fs_ofdsignature.h:66
fs_image.h
图像和位图相关定义和类的头文件。
foxit::ofd::ofdseal::Signature::operator !=
bool operator !=(const Signature &other) const
不相等操作符.
foxit::ofd::ofdseal::Signature::GetVerifyMessage
WString GetVerifyMessage()
获取验证结果详细信息。
foxit::ofd::ofdseal::SealSignature::GetSealVenderId
WString GetSealVenderId()
获取电子印章供应商ID。
foxit::ofd::ofdseal::VerifyExtendInfo
Definition: fs_ofdsignature.h:133
foxit::ofd::ofdseal::SealSignature::GetSealValidStartTime
WString GetSealValidStartTime()
获取电子印章有效起始时间。
foxit::ofd::ofdseal::Signature
Definition: fs_ofdsignature.h:209
foxit::ofd::ofdseal::OperateSignatureInfo::e_MosaicImage
删除印章/签名信息, 印章/签名图片马赛克。
Definition: fs_ofdsignature.h:39
foxit::ofd::ofdseal::OperateSignatureInfo::operator=
OperateSignatureInfo & operator=(const OperateSignatureInfo &other)
赋值操作符。
Definition: fs_ofdsignature.h:80
foxit::ofd::ofdseal::Signature::IsEmpty
bool IsEmpty() const
检查当前对象是否为空。
foxit::ofd::ofdseal::Signature::e_SignatureTypeSign
证书签名.。
Definition: fs_ofdsignature.h:222
foxit::ofd::ofdseal::SignSignature::IsEmpty
bool IsEmpty() const
检查当前对象是否为空。
foxit::ofd::ofdseal::OperateSignatureInfo::OperateSignatureInfo
OperateSignatureInfo(SignatureOperationType operation_type=e_RemoveInfoOnly, int atomize_horz_blur=5, int atomize_vert_blur=5, int mosaic_vector_length=5)
带参数的构造函数。
Definition: fs_ofdsignature.h:54
foxit::ofd::ofdseal::SealSignature::~SealSignature
~SealSignature()
析构函数。
foxit::ofd::ofdseal::Signature::GetCompany
WString GetCompany()
获取公司名称。
foxit::ofd::ofdseal::SignSignature::~SignSignature
~SignSignature()
析构函数。
foxit::ofd::ofdseal::SealSignature::ExportPublicCertificateFile
bool ExportPublicCertificateFile(const String &file_path)
导出公钥证书文件。
foxit::ofd::ofdseal::SealSignature::VerifyWithOes
bool VerifyWithOes(const Oes &oes, bool online=false)
使用指定的电子印章验证签章的有效性。
foxit::ofd::ofdseal::SealSignature::VerifyWithoutOes
bool VerifyWithoutOes(bool online=false)
不依赖电子印章库验证签章的有效性。
foxit::ofd::ofdseal::Signature::GetType
SignatureType GetType()
获取签名类型。
foxit::FS_HANDLE
void * FS_HANDLE
句柄类型。
Definition: fs_basictypes.h:213
foxit::ofd::ofdseal::SealSignature::GetSealValidEndTime
WString GetSealValidEndTime()
获取电子印章有效截止时间。
fs_common.h
通用定义和类的头文件。
foxit::ofd::ofdseal::Signature::e_SignatureTypeTimeStamp
时间戳签名。
Definition: fs_ofdsignature.h:224
foxit::ofd::ofdseal::VerifyExtendInfo::user_login
String user_login
调用验章功能的业务系统用户账号，必须为UTF-8编码。
Definition: fs_ofdsignature.h:199
foxit::ofd::ofdseal::SealSignature::GetSealName
WString GetSealName()
获取电子印章名称。
foxit::ofd::ofdseal::SealSignature::operator=
SealSignature & operator=(const SealSignature &other)
赋值操作符。
foxit::ofd::ofdseal::SealSignature::IsEmpty
bool IsEmpty() const
检查当前对象是否为空。
foxit::ofd::ofdseal::VerifyExtendInfo::Set
void Set(const String &application_name, const String &user_login, const String &file_name)
设置值。
Definition: fs_ofdsignature.h:183
foxit::Base
Definition: fs_basictypes.h:465
foxit::ofd::ofdseal::SealSignature::GetSealSignMethod
WString GetSealSignMethod()
获取电子印章签章算法。
foxit::ofd::ofdseal::OperateSignatureInfo::e_AtomizeImage
删除印章/签名信息, 印章/签名图片雾化。
Definition: fs_ofdsignature.h:37
foxit::ofd::ofdseal::VerifyExtendInfo::VerifyExtendInfo
VerifyExtendInfo(const VerifyExtendInfo &other)
构造函数，通过另一个验证扩展信息对象。
Definition: fs_ofdsignature.h:154
foxit::ofd::ofdseal::Signature::Signature
Signature(const Signature &other)
构造函数，通过另一个签名对象。
foxit::ofd::ofdseal::Signature::e_SignatureTypeDefault
默认类型。
Definition: fs_ofdsignature.h:218
foxit::ofd::ofdseal::OperateSignatureInfo::Set
void Set(SignatureOperationType operation_type, int atomize_horz_blur, int atomize_vert_blur, int mosaic_vector_length)
设置值。
Definition: fs_ofdsignature.h:99
foxit::ofd::ofdseal::SealSignature::GetSealId
WString GetSealId()
获取电子印章ID。
foxit
Foxit命名空间。
Definition: fs_taggedpdf.h:27
foxit::ofd::ofdseal::OperateSignatureInfo::SignatureOperationType
SignatureOperationType
OFD操作签章模式枚举。
Definition: fs_ofdsignature.h:31
CFX_ByteString
字节字符串类
Definition: fx_string.h:317
foxit::ofd::ofdseal::SignSignature::operator=
SignSignature & operator=(const SignSignature &other)
赋值操作符。
foxit::ofd::ofdseal::SealSignature::operator==
bool operator==(const SealSignature &other) const
相等操作符。
foxit::ofd::ofdseal::OperateSignatureInfo
Definition: fs_ofdsignature.h:24
foxit::ofd::ofdseal::OperateSignatureInfo::e_RemoveAll
完全删除印章及印章图片。
Definition: fs_ofdsignature.h:41
foxit::ofd::ofdseal::Signature::GetDigestMethod
WString GetDigestMethod()
获取摘要算法名称。
foxit::ofd::ofdseal::Signature::GetProviderName
WString GetProviderName()
获取提供者名称。
foxit::ofd::ofdseal::SealSignature::GetSealSignedDate
WString GetSealSignedDate()
获取电子印章签章时间。
foxit::ofd::ofdseal::VerifyExtendInfo::application_name
String application_name
调用验章功能的业务系统名称，必须为UTF-8编码。
Definition: fs_ofdsignature.h:193
foxit::ofd::ofdseal::SealSignature::GetSealType
WString GetSealType()
获取电子印章类型。
foxit::ofd::ofdseal::Signature::GetSignMethod
WString GetSignMethod()
获取签名算法名称。
foxit::ofd::ofdseal::SignSignature::GetImage
foxit::common::Bitmap GetImage()
获取电子印章图片。
foxit::ofd::ofdseal::SealSignature::GetImage
foxit::common::Bitmap GetImage()
获取电子印章图片。
foxit::ofd::ofdseal::OperateSignatureInfo::e_RemoveInfoOnly
仅删除印章/签名信息, 不删除印章/签名图片。
Definition: fs_ofdsignature.h:33
foxit::ofd::ofdseal::OperateSignatureInfo::e_ConvertToBlackImage
删除印章/签名信息, 红章转黑章(即将彩色图转为灰度图)。
Definition: fs_ofdsignature.h:35
foxit::ofd::ofdseal::SealSignature::SealSignature
SealSignature(Signature object)
构造函数，从现有foxit::ofd::ofdseal::Signature对象。
foxit::ofd::ofdseal::Signature::operator=
Signature & operator=(const Signature &other)
赋值操作符。
foxit::ofd::ofdseal::VerifyExtendInfo::file_name
String file_name
进行验章的文件名称，必须为UTF-8编码。
Definition: fs_ofdsignature.h:205
foxit::ofd::ofdseal::SignSignature::Verify
bool Verify()
验证签名的有效性。
foxit::ofd::ofdseal::SignSignature::SignSignature
SignSignature(Signature object)
构造函数，从现有foxit::ofd::ofdseal::Signature对象。
foxit::ofd::ofdseal::Signature::~Signature
~Signature()
析构函数。
foxit::ofd::ofdseal::Signature::SignatureType
SignatureType
OFD文档签名类型枚举。
Definition: fs_ofdsignature.h:216