All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
VerificationOptions.h
Go to the documentation of this file.
1 //---------------------------------------------------------------------------------------
2 // Copyright (c) 2001-2021 by PDFTron Systems Inc. All Rights Reserved.
3 // Consult legal.txt regarding legal and license information.
4 //---------------------------------------------------------------------------------------
5 
6 #ifndef PDFTRON_H_CPPPDFVerificationOptions
7 #define PDFTRON_H_CPPPDFVerificationOptions
8 #include <C/PDF/TRN_VerificationOptions.h>
9 
10 #include <Common/BasicTypes.h>
11 #include <Common/UString.h>
12 #include <PDF/PDFDoc.h>
13 
14 namespace pdftron { namespace PDF {
15 
16 
21 {
22 public:
23  //enums:
27  };
28  enum TimeMode {
29  e_signing = 0,
32  };
34  e_signing_trust = 1, // analogous to "kPSSigTrustSigning" in FDF cert exchange specification. Automatically set even when not specified, just like in Acrobat.
35  e_certification_trust = 2, // analogous to "kPSSigTrustAuthenticDocuments" in FDF cert exchange specification. Allows certifications using this identity to be verified.
36  e_dynamic_content = 4, /* analogous to "kPSSigTrustDynamicContent" in FDF cert exchange specification. Just like in Acrobat, does not invalidate dynamic documents,
37  just intended to stop viewers from allowing its use on documents which are not trusted for it. */
38  e_javascript = 16, /* analogous to "kPSSigTrustJavaScript" in FDF cert exchange specification. Just like in Acrobat, does not invalidate JavaScript-containing documents,
39  just intended to stop viewers from allowing its use on documents which are not trusted for it. */
40  e_identity = 32, // analogous to "kPSSigTrustIdentity" in FDF cert exchange specification. If this flag is not set, all other flags are ignored, and certificate is used only for path building.
41  e_trust_anchor = 64, // analogous to "kPSSigTrustAnchor" in FDF cert exchange specification. If this flag is set, paths may end with this certificate, and no revocation checks are done for it.
42  e_default_trust = 97, // handy shortcut for what Acrobat does by default -- trust for everything except javascript and dynamic
43  e_complete_trust = 119 // another handy shortcut for testing
44  };
46  VerificationOptions(TRN_VerificationOptions impl);
49 
50  void Destroy();
51 
52  //methods:
53 
60 
72  void AddTrustedCertificate(const UChar* in_certificate_buf, size_t in_buf_size, const UInt16 in_trust_flags = e_default_trust);
73 
82  void AddTrustedCertificate(const UString& in_filepath, const UInt16 in_trust_flags = e_default_trust);
83 
97  void AddTrustedCertificates(const UChar* in_P7C_binary_DER_certificates_file_data, const size_t in_size);
98 
108  void LoadTrustList(const FDF::FDFDoc& in_fdf_cert_exchange_data);
109 
115  void EnableModificationVerification(bool in_on_or_off);
116 
122  void EnableDigestVerification(bool in_on_or_off);
123 
129  void EnableTrustVerification(bool in_on_or_off);
130 
147  void EnableOnlineCRLRevocationChecking(bool in_on_or_off);
148 
154  void EnableOnlineOCSPRevocationChecking(bool in_on_or_off);
155 
156 
173  void EnableOnlineRevocationChecking(bool in_on_or_off);
174 
175 #ifndef SWIGHIDDEN
176  TRN_VerificationOptions m_impl;
177 #endif
178 
179 private:
180 
181 #ifndef SWIGHIDDEN
182  mutable bool m_owner;
183 #endif
184 };
185 
186 #include <Impl/VerificationOptions.inl>
187 } //end pdftron
188 } //end PDF
189 
190 
191 #endif //PDFTRON_H_CPPPDFVerificationOptions
TRN_UInt16 UInt16
Definition: BasicTypes.h:14
void EnableOnlineOCSPRevocationChecking(bool in_on_or_off)
void EnableOnlineRevocationChecking(bool in_on_or_off)
VerificationOptions & operator=(const VerificationOptions &other)
void EnableOnlineCRLRevocationChecking(bool in_on_or_off)
void AddTrustedCertificates(const UChar *in_P7C_binary_DER_certificates_file_data, const size_t in_size)
TRN_UChar UChar
Definition: BasicTypes.h:12
VerificationOptions(const VerificationOptions &other)
void LoadTrustList(const FDF::FDFDoc &in_fdf_cert_exchange_data)
void AddTrustedCertificate(const UChar *in_certificate_buf, size_t in_buf_size, const UInt16 in_trust_flags=e_default_trust)
void EnableDigestVerification(bool in_on_or_off)
void EnableTrustVerification(bool in_on_or_off)
void EnableModificationVerification(bool in_on_or_off)