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 {
43 
44 
59  }
60 
67  this->operation_type = other.operation_type;
71  }
72 
81  this->operation_type = other.operation_type;
85  return *this;
86  }
87 
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 
112 
118 
124 
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 = "") :
147  }
148 
156  user_login(other.user_login),
157  file_name(other.file_name) {
158  }
159 
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 
194 
200 
206 };
207 
209 class Signature : public Base {
210  public:
216  typedef enum _SignatureType {
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 
280 
287 
294 
301 
308 
315 
322 
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 
404 
411 
418 
425 
432 
439 
452 
459 
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 
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 
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_
bool Operate(const foxit::ofd::ofdseal::OperateSignatureInfo &info)
对OFD文档内的签名或签章进行操作。
Definition: fs_ofdsignature.h:540
文件写入接口。
Definition: fx_stream.h:470
bool operator==(const Signature &other) const
相等操作符。
Definition: fs_image.h:36
int mosaic_vector_length
马赛克向量长度。operation_type为e_MosaicImage时起作用。
Definition: fs_ofdsignature.h:129
int atomize_vert_blur
纵向高斯模糊。operation_type为e_AtomizeImage时起作用。
Definition: fs_ofdsignature.h:123
CFX_Object Object
对象类型。
Definition: fs_basictypes.h:220
bool operator==(const SignSignature &other) const
相等操作符。
bool operator !=(const SignSignature &other) const
不相等操作符。
bool ExportPublicCertificateFile(const String &file_path)
导出公钥证书文件。
SignatureOperationType operation_type
签章操作类型。请参考从 foxit::ofd::ofdseal::OperateSignatureInfo::e_RemoveInfoOnly 开始的值, 这应该是这些值中的一个。
Definition: fs_ofdsignature.h:111
WString GetVersion()
获取签名或签章版本。
bool VerifyEx(const foxit::ofd::ofdseal::VerifyExtendInfo &extend_info, bool online=false)
使用扩展信息验证签章的有效性。
VerifyExtendInfo & operator=(const VerifyExtendInfo &other)
赋值操作符。
Definition: fs_ofdsignature.h:167
WString GetSealVersion()
获取电子印章版本。
Definition: fs_ofdoesseal.h:143
电子签章.。
Definition: fs_ofdsignature.h:220
宽字符串类
Definition: fx_string.h:1457
VerifyExtendInfo(const String &application_name="", const String &user_login="", const String &file_name="")
带参数的构造函数。
Definition: fs_ofdsignature.h:143
bool Verify(bool online=false)
验证签章的有效性。
bool operator !=(const SealSignature &other) const
不相等操作符。
Definition: fs_ofdsignature.h:336
int atomize_horz_blur
横向高斯模糊。operation_type为e_AtomizeImage时起作用。
Definition: fs_ofdsignature.h:117
String GetSealSignerCertInfo()
获取电子印章签章者证书信息。
OperateSignatureInfo(const OperateSignatureInfo &other)
构造函数,通过另一个操作签名信息对象。
Definition: fs_ofdsignature.h:66
图像和位图相关定义和类的头文件。
bool operator !=(const Signature &other) const
不相等操作符.
WString GetVerifyMessage()
获取验证结果详细信息。
WString GetSealVenderId()
获取电子印章供应商ID。
Definition: fs_ofdsignature.h:133
WString GetSealValidStartTime()
获取电子印章有效起始时间。
Definition: fs_ofdsignature.h:209
删除印章/签名信息, 印章/签名图片马赛克。
Definition: fs_ofdsignature.h:39
OperateSignatureInfo & operator=(const OperateSignatureInfo &other)
赋值操作符。
Definition: fs_ofdsignature.h:80
bool IsEmpty() const
检查当前对象是否为空。
证书签名.。
Definition: fs_ofdsignature.h:222
bool IsEmpty() const
检查当前对象是否为空。
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
WString GetCompany()
获取公司名称。
bool ExportPublicCertificateFile(const String &file_path)
导出公钥证书文件。
bool VerifyWithOes(const Oes &oes, bool online=false)
使用指定的电子印章验证签章的有效性。
bool VerifyWithoutOes(bool online=false)
不依赖电子印章库验证签章的有效性。
SignatureType GetType()
获取签名类型。
void * FS_HANDLE
句柄类型。
Definition: fs_basictypes.h:213
WString GetSealValidEndTime()
获取电子印章有效截止时间。
通用定义和类的头文件。
时间戳签名。
Definition: fs_ofdsignature.h:224
String user_login
调用验章功能的业务系统用户账号,必须为UTF-8编码。
Definition: fs_ofdsignature.h:199
WString GetSealName()
获取电子印章名称。
SealSignature & operator=(const SealSignature &other)
赋值操作符。
bool IsEmpty() const
检查当前对象是否为空。
void Set(const String &application_name, const String &user_login, const String &file_name)
设置值。
Definition: fs_ofdsignature.h:183
Definition: fs_basictypes.h:465
WString GetSealSignMethod()
获取电子印章签章算法。
删除印章/签名信息, 印章/签名图片雾化。
Definition: fs_ofdsignature.h:37
VerifyExtendInfo(const VerifyExtendInfo &other)
构造函数,通过另一个验证扩展信息对象。
Definition: fs_ofdsignature.h:154
Signature(const Signature &other)
构造函数,通过另一个签名对象。
默认类型。
Definition: fs_ofdsignature.h:218
void Set(SignatureOperationType operation_type, int atomize_horz_blur, int atomize_vert_blur, int mosaic_vector_length)
设置值。
Definition: fs_ofdsignature.h:99
WString GetSealId()
获取电子印章ID。
Foxit命名空间。
Definition: fs_pdf3d.h:26
SignatureOperationType
OFD操作签章模式枚举。
Definition: fs_ofdsignature.h:31
字节字符串类
Definition: fx_string.h:317
SignSignature & operator=(const SignSignature &other)
赋值操作符。
bool operator==(const SealSignature &other) const
相等操作符。
Definition: fs_ofdsignature.h:24
完全删除印章及印章图片。
Definition: fs_ofdsignature.h:41
WString GetDigestMethod()
获取摘要算法名称。
WString GetProviderName()
获取提供者名称。
WString GetSealSignedDate()
获取电子印章签章时间。
String application_name
调用验章功能的业务系统名称,必须为UTF-8编码。
Definition: fs_ofdsignature.h:193
WString GetSealType()
获取电子印章类型。
WString GetSignMethod()
获取签名算法名称。
foxit::common::Bitmap GetImage()
获取电子印章图片。
foxit::common::Bitmap GetImage()
获取电子印章图片。
仅删除印章/签名信息, 不删除印章/签名图片。
Definition: fs_ofdsignature.h:33
删除印章/签名信息, 红章转黑章(即将彩色图转为灰度图)。
Definition: fs_ofdsignature.h:35
SealSignature(Signature object)
构造函数,从现有foxit::ofd::ofdseal::Signature对象。
Signature & operator=(const Signature &other)
赋值操作符。
String file_name
进行验章的文件名称,必须为UTF-8编码。
Definition: fs_ofdsignature.h:205
bool Verify()
验证签名的有效性。
SignSignature(Signature object)
构造函数,从现有foxit::ofd::ofdseal::Signature对象。
SignatureType
OFD文档签名类型枚举。
Definition: fs_ofdsignature.h:216