Foxit PDF SDK

Public Types | Public Member Functions | List of all members
foxit::pdf::LTVVerifier Class Reference
Inheritance diagram for foxit::pdf::LTVVerifier:

## Public Types
enum | TimeType { e_SignatureCreationTime = 0, e_SignatureTSTTime = 1, e_CurrentTime = 2, e_VRICreationTime = 3 }
| Enumeration for time type. More...
enum | VerifyMode { e_VerifyModeAcrobat = 1 }
| Enumeration for verifying mode. More...

## Public Member Functions
| LTVVerifier (const LTVVerifier &other)
| Constructor, with another LTV verifier object. More...
| LTVVerifier (const PDFDoc &document, bool is_verify_signature, bool use_expired_tst, bool ignore_doc_info, TimeType time_type)
| Constructor, with parameters. More...
| ~LTVVerifier ()
| Destructor.
void | AddDSS (const SignatureVerifyResult &signature_verify_result)
| Add the verify result (as VRI information) of a signature to the DSS. More...
bool | IsEmpty () const
| Check whether current object is empty or not. More...
bool | operator!= (const LTVVerifier &other) const
| Not equal operator. More...
LTVVerifier & | operator= (const LTVVerifier &other)
| Assign operator. More...
bool | operator== (const LTVVerifier &other) const
| Equal operator. More...
void | SetCertChainResolverCallback (CertChainResolverCallback *callback)
| Set a customized pdf::CertChainResolverCallback object if user wants to supply extra certificates to complete the certificate chain. More...
void | SetRevocationCallback (RevocationCallback *callback)
| Set a customized pdf::RevocationCallback object. More...
void | SetTrustedCertStoreCallback (TrustedCertStoreCallback *callback)
| Set a customized pdf::TrustedCertStoreCallback object if user wants to trust some certificates. More...
void | SetVerifyMode (VerifyMode mode)
| Set the verifying mode to specify which validation process is to be used. More...
SignatureVerifyResultArray | Verify ()
| Verify all the signatures in the PDF document which is used to constructed current object. More...
SignatureVerifyResultArray | VerifySignature (const Signature &signature)
| Verify the target signature in the PDF document which is used to constructed current object. More...
Public Member Functions inherited from foxit::Base
FS_HANDLE | Handle () const
| Get the handle of current object. More...

## Detailed Description

LTV verifier is used to verify signature in LTV work flow. Before use this class to verify signature(s), please ensure verify mode has been set by function LTVVerifier::SetVerifyMode.
Foxit PDF SDK has a default revocation callback for LTV verifier. If user wants to use customized revocation callback, please refer to function LTVVerifier::SetRevocationCallback.
If user wants to trust some certificates, please refer to function LTVVerifier::SetTrustedCertStoreCallback.

## Member Enumeration Documentation

## ◆ TimeType

enum foxit::pdf::LTVVerifier::TimeType

Enumeration for time type.

Values of this enumeration should be used alone.

Enumerator
e_SignatureCreationTime | Use signature creation time.
e_SignatureTSTTime | Use the time of signature time stamp token.
e_CurrentTime | Use current time.
e_VRICreationTime | Use the creation time of VRI dictionary of a signature. Note VRI means "validation-related information".

## ◆ VerifyMode

enum foxit::pdf::LTVVerifier::VerifyMode

Enumeration for verifying mode.

Values of this enumeration should be used alone.

Enumerator
e_VerifyModeAcrobat | Use Acrobat validation process.

## Constructor & Destructor Documentation

## ◆ LTVVerifier() [1/2]

foxit::pdf::LTVVerifier::LTVVerifier | ( | const PDFDoc & | document,
|  | bool | is_verify_signature,
|  | bool | use_expired_tst,
|  | bool | ignore_doc_info,
|  | TimeType | time_type
| ) |  |
| explicit

Constructor, with parameters.

Parameters

  [in] | document | A valid PDF document object.
  [in] | is_verify_signature | (Only available for LTVVerifier::e_VerifyModeAcrobat) Use to decide whether to verify signature validity when verifying signature or not.
  [in] | use_expired_tst | (Only available for LTVVerifier::e_VerifyModeAcrobat) Use to decide whether to use expired TST to verify signature or not.
  [in] | ignore_doc_info | (Only available for LTVVerifier::e_VerifyModeAcrobat) Use to decide whether to ignore the revocation information in DSS and signature or not.
  [in] | time_type | (Only available for LTVVerifier::e_VerifyModeAcrobat) Use to speicify the time type which is expected to be used for verifying. Please refer to values starting from LTVVerifier::e_SignatureCreationTime and this should be one of these values except LTVVerifier::e_VRICreationTime.

## ◆ LTVVerifier() [2/2]

foxit::pdf::LTVVerifier::LTVVerifier | ( | const LTVVerifier & | other | ) |

Constructor, with another LTV verifier object.

Parameters

  [in] | other | Another LTV verifier object.

## Member Function Documentation

## ◆ AddDSS()

void foxit::pdf::LTVVerifier::AddDSS | ( | const SignatureVerifyResult & | signature_verify_result | ) |

Add the verify result (as VRI information) of a signature to the DSS.

Parameters

  [in] | signature_verify_result | A signature verify result to be added to DSS.

Returns
  None.

## ◆ IsEmpty()

bool foxit::pdf::LTVVerifier::IsEmpty | ( |  | ) | const

Check whether current object is empty or not.

When the current object is empty, that means current object is useless.

Returns
  true means current object is empty, while false means not.

## ◆ operator!=()

bool foxit::pdf::LTVVerifier::operator!= | ( | const LTVVerifier & | other | ) | const

Not equal operator.

Parameters

  [in] | other | Another LTV verifier object. This function will check if current object is not equal to this one.

Returns
  true means not equal, while false means equal.

## ◆ operator=()

LTVVerifier& foxit::pdf::LTVVerifier::operator= | ( | const LTVVerifier & | other | ) |

Assign operator.

Parameters

  [in] | other | Another LTV verifier object, whose value would be assigned to current object.

Returns
  Reference to current object itself.

## ◆ operator==()

bool foxit::pdf::LTVVerifier::operator== | ( | const LTVVerifier & | other | ) | const

Equal operator.

Parameters

  [in] | other | Another LTV verifier object. This function will check if current object is equal to this one.

Returns
  true means equal, while false means not equal.

## ◆ SetCertChainResolverCallback()

void foxit::pdf::LTVVerifier::SetCertChainResolverCallback | ( | CertChainResolverCallback * | callback | ) |

Set a customized pdf::CertChainResolverCallback object if user wants to supply extra certificates to complete the certificate chain.

Parameters

  [in] | callback | A customized cert chain resolver callback object, which is implemented based on callback class pdf::CertChainResolverCallback. This can be set to NULL which means not to use it.

Returns
  None.

Note
  Only available when using the default internal revocation callback of Foxit PDF SDK.

## ◆ SetRevocationCallback()

void foxit::pdf::LTVVerifier::SetRevocationCallback | ( | RevocationCallback * | callback | ) |

Set a customized pdf::RevocationCallback object.

If no customized revocation callback is set by this function, Foxit PDF SDK will use a default one.

Parameters

  [in] | callback | A customized revocation callback object, which is implemented based on callback class pdf::RevocationCallback. This should not be NULL.

Returns
  None.

## ◆ SetTrustedCertStoreCallback()

void foxit::pdf::LTVVerifier::SetTrustedCertStoreCallback | ( | TrustedCertStoreCallback * | callback | ) |

Set a customized pdf::TrustedCertStoreCallback object if user wants to trust some certificates.

If no trusted cert store callback object is set by this function, no certificate will be trusted during verifying process.

Parameters

  [in] | callback | A customized trusted cert store callback object, which is implemented based on callback class pdf::TrustedCertStoreCallback. This can be set to NULL which means not to use it.

## ◆ SetVerifyMode()

void foxit::pdf::LTVVerifier::SetVerifyMode | ( | VerifyMode | mode | ) |

Set the verifying mode to specify which validation process is to be used.

Please ensure to set the verify mode before doing verifying.

Parameters

  [in] | mode | The verify mode used for express verify process. Please refer to values starting from LTVVerifier::e_VerifyModeAcrobat and this should be one of these values.

Returns
  None.

## ◆ Verify()

SignatureVerifyResultArray foxit::pdf::LTVVerifier::Verify | ( |  | ) |

Verify all the signatures in the PDF document which is used to constructed current object.

If verify mode is not LTVVerifier::e_VerifyModeAcrobat, the verifying process will stop immediately when fail to verify any signature and return verify results for successfully verified signatures only. If verify mode is LTVVerifier::e_VerifyModeAcrobat, all the signatures will be verified and return verify results for all the signatures.

Returns
  An array of signature verify results.

## ◆ VerifySignature()

SignatureVerifyResultArray foxit::pdf::LTVVerifier::VerifySignature | ( | const Signature & | signature | ) |

Verify the target signature in the PDF document which is used to constructed current object.

Parameters

  [in] | signature | Target signature to be verified. If verify mode is LTVVerifier::e_VerifyModeAcrobat, this function will verify signatures until target signature. If verify mode is not LTVVerifier::e_VerifyModeAcrobat, this function will only verify target signature.

Returns
  An array of signature verify result.