15 #ifndef FS_SIGNATURE_H_ 16 #define FS_SIGNATURE_H_ 111 typedef enum _States {
177 typedef enum _APFlags {
203 typedef enum _KeyName {
223 typedef enum _DigestAlgorithm {
239 typedef enum _SignatureType {
251 typedef enum _PAdESLevel {
1007 void SetImage(
const char* file_path,
int frame_index);
1025 void SetImage(
const wchar_t* file_path,
int frame_index);
1120 #ifndef __EMSCRIPTEN_RENDER__ 1142 typedef enum _CertValidity {
1188 uint32 size_of_array,
const Signature& signature,
const void* client_data) = 0;
1245 virtual String Sign(
const void* digest,
uint32 digest_length,
const wchar_t* cert_path,
1247 void* client_data) = 0;
1273 void* client_data) = 0;
1298 const void* signed_data,
uint32 signed_data_len,
1299 void* client_data) = 0;
1335 class TimeStampServer;
1456 typedef enum _SendRequestResult {
1545 #endif // FS_SIGNATURE_H_ Send request successfully.
Definition: fs_signature.h:1458
If set, show signing time on signature appearance.
Definition: fs_signature.h:185
If set, show distinguish name on signature appearance.
Definition: fs_signature.h:187
common::Bitmap GetBitmap()
Get a bitmap which is used for the signature appearance.
Out of memory during sending request process.
Definition: fs_signature.h:1472
Signature digest algorithm: sha1 algorithm.
Definition: fs_signature.h:225
Certificate is unsupport type.
Definition: fs_signature.h:1148
Signature key name: location.
Definition: fs_signature.h:207
The document has been changed outside of signature scope, and the changed invalidate the signature.
Definition: fs_signature.h:169
Certificate's private key cannot be gotten.
Definition: fs_signature.h:1158
Definition: fs_image.h:36
Signature key name: distinguish name.
Definition: fs_signature.h:213
TimeStampServer(const TimeStampServer &other)
Constructor, with another time stamp server object.
Unsigned signature.
Definition: fs_signature.h:117
If set, show text content on signature appearance.
Definition: fs_signature.h:195
CFX_Object Object
Object type.
Definition: fs_basictypes.h:219
~TimeStampServer()
Destructor.
static int GetServerIndex(const TimeStampServer &server)
Get the index of a speicified time stamp server object.
If set, show location on signature appearance.
Definition: fs_signature.h:189
TimeStampServer & operator=(const TimeStampServer &other)
Assign operator.
bool IsSigned()
Check whether current signature is signed or not.
Certificate for verifying issuer is revoked.
Definition: fs_signature.h:141
void SetAppearanceContent(const String &appearance_content)
Set customized appearance content (as low level drawing operation commands) for signed signature appe...
Certificate is valid.
Definition: fs_signature.h:1144
SignatureType GetSignatureType()
Get signature type.
Definition: fs_basictypes.h:226
Definition: fs_basictypes.h:426
Verification state of the time stamp is invalid.
Definition: fs_signature.h:155
static int GetServerCount()
Get time stamp server count.
bool operator!=(const TimeStampServer &other) const
Not equal operator.
States
Enumeration for signature states.
Definition: fs_signature.h:111
int32 GetCertCount() const
Get the count of certificates in current signature's certificate chain.
KeyName
Enumeration for signature key name.
Definition: fs_signature.h:203
Signature type: ordinary.
Definition: fs_signature.h:241
String GetFilter()
Get filter.
The document has not been changed within the scope of the signature.
Definition: fs_signature.h:135
No time stamp or not check time stamp.
Definition: fs_signature.h:149
Certificate's path is wrong.
Definition: fs_signature.h:1154
Header file for file operation related definitions and functions.
void SetSubFilter(const char *sub_filter)
Set sub filter.
File reading interface.
Definition: fx_stream.h:555
void SetSignTime(const DateTime &sign_time)
Set time of signing.
virtual uint32 VerifySigState(const void *digest, uint32 digest_length, const void *signed_data, uint32 signed_data_len, void *client_data)=0
A callback function used to verify the integrity of a signature and return the verify state.
WIDE STRING CLASS.
Definition: fx_string.h:1452
static TimeStampServer AddServer(const WString &server_name, const WString &server_url, const WString &user_name, const WString &password)
Add a time stamp server to the manager.
bool operator==(const TimeStampServer &other) const
Equal operator.
Unsupported signature.
Definition: fs_signature.h:127
SignatureType
Enumeration for signature type.
Definition: fs_signature.h:239
State
Enumeration for progress state.
Definition: fs_common.h:472
Definition: fs_signature.h:1343
Not check the issuer.
Definition: fs_signature.h:145
PAdES level: B-LT.
Definition: fs_signature.h:261
If set, show bitmap on signature appearance.
Definition: fs_signature.h:193
bool IsEmpty() const
Check whether current object is empty or not.
WString GetKeyValue(KeyName key)
Get the string value for specified key name.
Definition: fs_pdfdoc.h:352
virtual CertValidity CheckCertificateValidity(const wchar_t *cert_path, const WString &cert_password, void *client_data)=0
A callback function used to check the validity of a certificate.
Unknown signature.
Definition: fs_signature.h:113
Signature key name: contact information.
Definition: fs_signature.h:211
virtual bool StartCalcDigest(const common::file::ReaderCallback *file, const uint32 *byte_range_array, uint32 size_of_array, const Signature &signature, const void *client_data)=0
A callback function used to start a custom digest calculation, mainly to initialize the calculation p...
static TimeStampServer GetServer(int index)
Get time stamp server with specified index.
The document has been changed within the scope of the signature. (This indicates that signature is in...
Definition: fs_signature.h:131
PAdES level: B-T.
Definition: fs_signature.h:259
PDFDoc GetSignedVersionDocument(const wchar_t *file_path)
Get the PDF document in the signed version in which current signature was signed.
SendRequestResult SendTimeStampRequest(const String &request)
Send time stamp request.
Header file for image and bitmap related definitions and classes.
Signature key name: reason.
Definition: fs_signature.h:209
If set, show reason on signature appearance.
Definition: fs_signature.h:183
Signature data is destroyed (that means the signature data cannot be parsed properly).
Definition: fs_signature.h:125
virtual common::Progressive::State ContinueCalcDigest(const void *client_data, const common::PauseCallback *pause)=0
A callback function used to continue the custom digest calculation process.
Certificate is expired.
Definition: fs_signature.h:1146
Definition: fs_signature.h:1135
Certificate's password is wrong.
Definition: fs_signature.h:1152
Verification state of the time stamp is expired.
Definition: fs_signature.h:157
bool GetByteRangeArray(uint32 out_byte_range_array[4])
Get the byte ranges data, including 4 elements.
Certificate's data is error.
Definition: fs_signature.h:1150
Certificate for verifying issuer is expired.
Definition: fs_signature.h:143
Verification state of the issuer is unknown.
Definition: fs_signature.h:139
If set, show signer on signature appearance.
Definition: fs_signature.h:191
Verification state of the time stamp time is valid, since the times is before the expiration date.
Definition: fs_signature.h:163
Verification state of the time stamp issuer is valid.
Definition: fs_signature.h:161
common::Progressive StartVerify(const void *client_data=0, common::PauseCallback *pause=0)
Start verifying the intergrity of current signature if current signature is signed.
Not a PAdES signature.
Definition: fs_signature.h:253
void SetFilter(const char *filter)
Set filter.
ErrorCode
Enumeration for error code.
Definition: fs_basictypes.h:236
String GetTimeStampMessage()
Get time stamp message.
CertValidity
Enumeration for certificate validity.
Definition: fs_signature.h:1142
Definition: fs_signature.h:1449
File stream interface, reading & writing.
Definition: fx_stream.h:649
void SetDefaultContentsLength(uint32 default_length)
Set the default length of signature contents which represents signature value (known as signed data).
Fail to receive data during sending request process.
Definition: fs_signature.h:1466
PAdES level: B-LTA.
Definition: fs_signature.h:263
Definition: fx_basic.h:3737
Fail to connect during sending request process.
Definition: fs_signature.h:1462
Signature(const interform::Field &field)
Constructor, with parent class object.
virtual bool IsNeedPadData()=0
A callback function used to check whether to return all contents with padding zero or not,...
DigestAlgorithm
Enumeration for signature digest algorithm.
Definition: fs_signature.h:223
virtual void Release()=0
A callback function used to release current callback object itself.
objects::PDFDictionary * GetSignatureDict() const
Get signature dictionary.
Definition: fs_common.h:465
Verification state of the time stamp issuer is unknown.
Definition: fs_signature.h:159
The verified issue is current issuer.
Definition: fs_signature.h:147
void SetBitmap(const common::Bitmap &bitmap)
Set a bitmap for the signature appearance.
FX_UINT32 uint32
32-bit unsigned integer.
Definition: fs_basictypes.h:198
Signed signature.
Definition: fs_signature.h:119
static void Release()
Release time stamp server manager.
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:216
static TimeStampServer GetDefaultServer()
Get default time stamp server object.
Header file for common definitions and classes.
void SetCertChain(const WStringArray &cert_chain)
Set a certificate chain.
APFlags
Enumeration for signature appearance flags.
Definition: fs_signature.h:177
void SetAppearanceFlags(uint32 appearance_flags)
Set signature appearance flags.
String GetCertificateInfo(const char *key)
Get certificate information.
String GetSubFilter()
Get sub filter.
Verification state of a signature is invalid.
Definition: fs_signature.h:123
SendRequestResult
Enumeration for the result of sending time stamp request.
Definition: fs_signature.h:1456
PDFDoc GetDocument()
Get the PDF document, which current signature belongs to.
void SetKeyValue(KeyName key, const wchar_t *value)
Set the string value for specified key name.
void SetImage(const common::Image &image, int frame_index)
Set an image for the signature appearance, with a specified frame index.
FX_INT32 int32
32-bit signed integer.
Definition: fs_basictypes.h:196
Definition: fs_basictypes.h:393
Verification state of a signature is valid.
Definition: fs_signature.h:121
Fail to create socket during sending request process.
Definition: fs_signature.h:1460
Fail to send data during sending request process.
Definition: fs_signature.h:1464
Fail to get data during sending request process.
Definition: fs_signature.h:1470
Signature key name: text content.
Definition: fs_signature.h:215
Verification state of the issuer is valid.
Definition: fs_signature.h:137
Signature type: time stamp.
Definition: fs_signature.h:243
Definition: fs_pdfobject.h:763
Foxit namespace.
Definition: fs_compare.h:27
PAdESLevel GetPAdESLevel()
Get PAdES level.
bool IsTimeStamp()
Check if current signature is a time stamp signature.
DateTime GetSignTime()
Get time of signing.
static void RemoveServer(int index)
Remove a time stamp server from the manager, by index.
If set, show Foxit flag on signature appearance.
Definition: fs_signature.h:179
Signature cannot be trusted (containing aggression).
Definition: fs_signature.h:133
BYTE STRING CLASS.
Definition: fx_string.h:317
Certificate is not set to sign a signature.
Definition: fs_signature.h:1156
bool IsEmpty() const
Check whether current object is empty or not.
PAdESLevel
Enumeration for PAdES level.
Definition: fs_signature.h:251
WString GetCert(int32 index) const
Get a certificate from current signature's certificate chain by index.
Signature digest algorithm: sha512 algorithm.
Definition: fs_signature.h:231
Signature key name: signer.
Definition: fs_signature.h:205
virtual String GetDigest(const void *client_data)=0
A callback function used to get the digest after the calculation process is finished.
static ErrorCode Initialize()
Initialize time stamp server manager.
#define NULL
The null-pointer value.
Definition: fx_system.h:767
Definition: fs_signature.h:93
Signature digest algorithm: sha384 algorithm.
Definition: fs_signature.h:229
static void SetDefaultServer(int index)
Set default time stamp server object by index.
Cannot get verify relevant information.
Definition: fs_signature.h:165
Signature does not have any data for signing.
Definition: fs_signature.h:115
Signature digest algorithm: sha256 algorithm.
Definition: fs_signature.h:227
PAdES level: none.
Definition: fs_signature.h:255
Verification state of the time stamp is valid.
Definition: fs_signature.h:153
The document has been changed outside of signature scope, but the changed is permitted.
Definition: fs_signature.h:167
Fail to request during sending request process.
Definition: fs_signature.h:1468
~Signature()
Destructor.
Definition: fs_signature.h:284
uint32 GetState()
Get current state.
Definition: fs_image.h:430
virtual String Sign(const void *digest, uint32 digest_length, const wchar_t *cert_path, const WString &cert_password, Signature::DigestAlgorithm digest_algorithm, void *client_data)=0
A callback function used to do signing and return the signed data.
PAdES level: B-B.
Definition: fs_signature.h:257
bool ClearSignedData()
Clear the data and appearance if current signature is singed and verified valid.
If set, show label on signature appearance.
Definition: fs_signature.h:181
common::Progressive StartSign(const wchar_t *cert_path, const WString &cert_password, DigestAlgorithm digest_algorithm, const char *save_path, const void *client_data=0, common::PauseCallback *pause=0)
Start signing current signature if current signature is unsigned.
The signature is a time stamp signature.
Definition: fs_signature.h:151
Non expected byte range.
Definition: fs_signature.h:129
uint32 GetAppearanceFlags()
Get signature appearance flags.