- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
VerificationResult.h
Go to the documentation of this file.
1 //---------------------------------------------------------------------------------------
2 // Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved.
3 // Consult legal.txt regarding legal and license information.
4 //---------------------------------------------------------------------------------------
5
6 #ifndef PDFTRON_H_CPPPDFVerificationResult
7 #define PDFTRON_H_CPPPDFVerificationResult
8 #include <C/PDF/TRN_VerificationResult.h>
9
10 #include <Common/BasicTypes.h>
11 #include <Common/UString.h>
12 #include <PDF/PDFDoc.h>
13
14 #include <Crypto/DigestAlgorithm.h>
15 #include <PDF/DisallowedChange.h>
16
17 #include <vector>
18
19 namespace pdftron { namespace PDF {
20 class TrustVerificationResult;
21
25 class VerificationResult
26 {
27 public:
28 typedef pdftron::PDF::DisallowedChange DisallowedChange;
29 //enums:
30 enum DocumentStatus {
31 e_no_error = 0,
32 e_corrupt_file = 1,
33 e_unsigned = 2,
34 e_bad_byteranges = 3,
35 e_corrupt_cryptographic_contents = 4
36 };
37 enum DigestStatus {
38 e_digest_invalid = 0,
39 e_digest_verified = 1,
40 e_digest_verification_disabled = 2,
41 e_weak_digest_algorithm_but_digest_verifiable = 3,
42 e_no_digest_status = 4,
43 e_unsupported_encoding = 5,
44 e_unsupported_digest_algorithm = 6
45 };
46 enum TrustStatus {
47 e_trust_verified = 0,
48 e_untrusted = 1,
49 e_trust_verification_disabled = 2,
50 e_no_trust_status = 3,
51 e_unsupported_trust_features = 4
52 };
53 enum ModificationPermissionsStatus {
54 e_invalidated_by_disallowed_changes = 0,
55 e_has_allowed_changes = 1,
56 e_unmodified = 2,
57 e_permissions_verification_disabled = 3,
58 e_no_permissions_status = 4,
59 e_unsupported_permissions_features = 5
60 };
61 VerificationResult(const VerificationResult& other);
62 VerificationResult& operator= (const VerificationResult& other);
63 ~VerificationResult();
64
65 void Destroy();
66
67 //methods:
68
78 bool GetVerificationStatus() const;
79
85 DocumentStatus GetDocumentStatus() const;
86
92 DigestStatus GetDigestStatus() const;
93
99 TrustStatus GetTrustStatus() const;
100
106 ModificationPermissionsStatus GetPermissionsStatus() const;
107
113 bool HasTrustVerificationResult() const;
121 TrustVerificationResult GetTrustVerificationResult() const;
122
128 std::vector<DisallowedChange> GetDisallowedChanges() const;
129
136 Crypto::DigestAlgorithm::Type GetDigestAlgorithm() const;
137
143 UString GetDocumentStatusAsString() const;
144
150 UString GetDigestStatusAsString() const;
151
157 UString GetTrustStatusAsString() const;
158
164 UString GetPermissionsStatusAsString() const;
165
179 #ifdef SWIG
180 // We use an std::vector of UTF-8 std::strings for SWIG, because SWIG has trouble with mapping UString to string when it's in a vector<UString>.
181 std::vector<std::string> GetUnsupportedFeatures() const;
182 #else
183 std::vector<UString> GetUnsupportedFeatures() const;
184 #endif
185
186 #ifdef SWIG
187 VerificationResult();
188 #endif
189
190 #ifndef SWIGHIDDEN
191 VerificationResult(TRN_VerificationResult impl);
192 TRN_VerificationResult m_impl;
193 #endif
194
195 private:
196
197 #ifndef SWIGHIDDEN
198 mutable bool m_owner;
199 #endif
200 };
201
202
203 } //end pdftron
204 } //end PDF
205
206 #include <Impl/TrustVerificationResult.inl>
207
208 #endif //PDFTRON_H_CPPPDFVerificationResult
pdftron::PDF::VerificationResult::GetPermissionsStatusAsString
UString GetPermissionsStatusAsString() const
pdftron::PDF::DisallowedChange
Definition: DisallowedChange.h:24
pdftron::PDF::VerificationResult::e_has_allowed_changes
Definition: VerificationResult.h:55
pdftron::PDF::VerificationResult::~VerificationResult
~VerificationResult()
pdftron::PDF::VerificationResult::ModificationPermissionsStatus
ModificationPermissionsStatus
Definition: VerificationResult.h:53
pdftron::PDF::VerificationResult::GetDocumentStatus
DocumentStatus GetDocumentStatus() const
pdftron::PDF::VerificationResult::e_invalidated_by_disallowed_changes
Definition: VerificationResult.h:54
UString.h
pdftron::PDF::VerificationResult::e_digest_verification_disabled
Definition: VerificationResult.h:40
pdftron::PDF::VerificationResult::TrustStatus
TrustStatus
Definition: VerificationResult.h:46
pdftron::PDF::VerificationResult::e_unsupported_encoding
Definition: VerificationResult.h:43
pdftron::PDF::VerificationResult::DigestStatus
DigestStatus
Definition: VerificationResult.h:37
pdftron::PDF::VerificationResult::GetUnsupportedFeatures
std::vector< UString > GetUnsupportedFeatures() const
DisallowedChange.h
pdftron::PDF::VerificationResult::e_untrusted
Definition: VerificationResult.h:48
pdftron::PDF::VerificationResult::VerificationResult
VerificationResult(const VerificationResult &other)
pdftron::PDF::VerificationResult::GetPermissionsStatus
ModificationPermissionsStatus GetPermissionsStatus() const
pdftron::PDF::VerificationResult::e_weak_digest_algorithm_but_digest_verifiable
Definition: VerificationResult.h:41
pdftron::PDF::VerificationResult::e_corrupt_cryptographic_contents
Definition: VerificationResult.h:35
pdftron::PDF::VerificationResult::e_unsigned
Definition: VerificationResult.h:33
pdftron::PDF::VerificationResult::DocumentStatus
DocumentStatus
Definition: VerificationResult.h:30
pdftron::PDF::VerificationResult::e_digest_verified
Definition: VerificationResult.h:39
pdftron::PDF::VerificationResult::GetTrustStatusAsString
UString GetTrustStatusAsString() const
pdftron::PDF::VerificationResult::m_impl
TRN_VerificationResult m_impl
Definition: VerificationResult.h:192
pdftron::PDF::VerificationResult::HasTrustVerificationResult
bool HasTrustVerificationResult() const
pdftron::PDF::VerificationResult::e_trust_verification_disabled
Definition: VerificationResult.h:49
pdftron::PDF::VerificationResult::e_no_permissions_status
Definition: VerificationResult.h:58
pdftron::PDF::VerificationResult::operator=
VerificationResult & operator=(const VerificationResult &other)
pdftron::PDF::VerificationResult::e_no_trust_status
Definition: VerificationResult.h:50
pdftron::PDF::VerificationResult::e_unsupported_permissions_features
Definition: VerificationResult.h:59
pdftron::PDF::VerificationResult::e_no_digest_status
Definition: VerificationResult.h:42
pdftron::PDF::VerificationResult::GetDocumentStatusAsString
UString GetDocumentStatusAsString() const
pdftron::PDF::VerificationResult::e_corrupt_file
Definition: VerificationResult.h:32
PDFDoc.h
pdftron::PDF::VerificationResult::e_unsupported_trust_features
Definition: VerificationResult.h:51
pdftron::PDF::VerificationResult::GetDisallowedChanges
std::vector< DisallowedChange > GetDisallowedChanges() const
pdftron::PDF::VerificationResult::GetVerificationStatus
bool GetVerificationStatus() const
pdftron::PDF::VerificationResult::GetDigestStatus
DigestStatus GetDigestStatus() const
BasicTypes.h
pdftron::PDF::VerificationResult
Definition: VerificationResult.h:25
DigestAlgorithm.h
pdftron::PDF::VerificationResult::e_unsupported_digest_algorithm
Definition: VerificationResult.h:44
pdftron::PDF::VerificationResult::e_bad_byteranges
Definition: VerificationResult.h:34
pdftron::PDF::VerificationResult::e_trust_verified
Definition: VerificationResult.h:47
pdftron::PDF::VerificationResult::e_no_error
Definition: VerificationResult.h:31
pdftron::PDF::TrustVerificationResult
Definition: TrustVerificationResult.h:23
pdftron::PDF::VerificationResult::GetDigestAlgorithm
Crypto::DigestAlgorithm::Type GetDigestAlgorithm() const
pdftron::PDF::VerificationResult::GetTrustStatus
TrustStatus GetTrustStatus() const
pdftron::PDF::VerificationResult::e_unmodified
Definition: VerificationResult.h:56
pdftron::UString
Definition: UString.h:27
pdftron::PDF::VerificationResult::GetDigestStatusAsString
UString GetDigestStatusAsString() const
pdftron::PDF::VerificationResult::GetTrustVerificationResult
TrustVerificationResult GetTrustVerificationResult() const
pdftron::Crypto::DigestAlgorithm::Type
Type
Definition: DigestAlgorithm.h:21
pdftron::PDF::VerificationResult::e_permissions_verification_disabled
Definition: VerificationResult.h:57
pdftron::PDF::VerificationResult::Destroy
void Destroy()
pdftron::PDF::VerificationResult::DisallowedChange
pdftron::PDF::DisallowedChange DisallowedChange
Definition: VerificationResult.h:28
pdftron::PDF::VerificationResult::e_digest_invalid
Definition: VerificationResult.h:38