Changeset View
Changeset View
Standalone View
Standalone View
generators/poppler/pdfsignatureutils.cpp
Show First 20 Lines • Show All 187 Lines • ▼ Show 20 Line(s) | 187 | case Poppler::SignatureValidationInfo::CertificateNotVerified: | |||
---|---|---|---|---|---|
188 | return CertificateNotVerified; | 188 | return CertificateNotVerified; | ||
189 | default: | 189 | default: | ||
190 | return CertificateStatusUnknown; | 190 | return CertificateStatusUnknown; | ||
191 | } | 191 | } | ||
192 | } | 192 | } | ||
193 | 193 | | |||
194 | PopplerSignatureInfo::HashAlgorithm PopplerSignatureInfo::hashAlgorithm() const | 194 | PopplerSignatureInfo::HashAlgorithm PopplerSignatureInfo::hashAlgorithm() const | ||
195 | { | 195 | { | ||
196 | #ifdef HAVE_POPPLER_0_58 | ||||
196 | switch ( m_info.hashAlgorithm() ) | 197 | switch ( m_info.hashAlgorithm() ) | ||
197 | { | 198 | { | ||
198 | case Poppler::SignatureValidationInfo::HashAlgorithmMd2: | 199 | case Poppler::SignatureValidationInfo::HashAlgorithmMd2: | ||
199 | return HashAlgorithmMd2; | 200 | return HashAlgorithmMd2; | ||
200 | case Poppler::SignatureValidationInfo::HashAlgorithmMd5: | 201 | case Poppler::SignatureValidationInfo::HashAlgorithmMd5: | ||
201 | return HashAlgorithmMd5; | 202 | return HashAlgorithmMd5; | ||
202 | case Poppler::SignatureValidationInfo::HashAlgorithmSha1: | 203 | case Poppler::SignatureValidationInfo::HashAlgorithmSha1: | ||
203 | return HashAlgorithmSha1; | 204 | return HashAlgorithmSha1; | ||
204 | case Poppler::SignatureValidationInfo::HashAlgorithmSha256: | 205 | case Poppler::SignatureValidationInfo::HashAlgorithmSha256: | ||
205 | return HashAlgorithmSha256; | 206 | return HashAlgorithmSha256; | ||
206 | case Poppler::SignatureValidationInfo::HashAlgorithmSha384: | 207 | case Poppler::SignatureValidationInfo::HashAlgorithmSha384: | ||
207 | return HashAlgorithmSha384; | 208 | return HashAlgorithmSha384; | ||
208 | case Poppler::SignatureValidationInfo::HashAlgorithmSha512: | 209 | case Poppler::SignatureValidationInfo::HashAlgorithmSha512: | ||
209 | return HashAlgorithmSha512; | 210 | return HashAlgorithmSha512; | ||
210 | case Poppler::SignatureValidationInfo::HashAlgorithmSha224: | 211 | case Poppler::SignatureValidationInfo::HashAlgorithmSha224: | ||
211 | return HashAlgorithmSha224; | 212 | return HashAlgorithmSha224; | ||
212 | default: | 213 | default: | ||
213 | return HashAlgorithmUnknown; | 214 | return HashAlgorithmUnknown; | ||
214 | } | 215 | } | ||
216 | #else | ||||
217 | return HashAlgorithmUnknown; | ||||
218 | #endif | ||||
215 | } | 219 | } | ||
216 | 220 | | |||
217 | QString PopplerSignatureInfo::signerName() const | 221 | QString PopplerSignatureInfo::signerName() const | ||
218 | { | 222 | { | ||
219 | return m_info.signerName(); | 223 | return m_info.signerName(); | ||
220 | } | 224 | } | ||
221 | 225 | | |||
222 | QString PopplerSignatureInfo::signerSubjectDN() const | 226 | QString PopplerSignatureInfo::signerSubjectDN() const | ||
223 | { | 227 | { | ||
228 | #ifdef HAVE_POPPLER_0_58 | ||||
224 | return m_info.signerSubjectDN(); | 229 | return m_info.signerSubjectDN(); | ||
230 | #else | ||||
231 | return {}; | ||||
232 | #endif | ||||
225 | } | 233 | } | ||
226 | 234 | | |||
227 | QString PopplerSignatureInfo::location() const | 235 | QString PopplerSignatureInfo::location() const | ||
228 | { | 236 | { | ||
229 | #ifdef HAVE_POPPLER_0_68 | 237 | #ifdef HAVE_POPPLER_0_68 | ||
230 | return m_info.location(); | 238 | return m_info.location(); | ||
231 | #else | 239 | #else | ||
232 | return {}; | 240 | return {}; | ||
Show All 11 Lines | |||||
244 | 252 | | |||
245 | QDateTime PopplerSignatureInfo::signingTime() const | 253 | QDateTime PopplerSignatureInfo::signingTime() const | ||
246 | { | 254 | { | ||
247 | return QDateTime::fromTime_t( m_info.signingTime() ); | 255 | return QDateTime::fromTime_t( m_info.signingTime() ); | ||
248 | } | 256 | } | ||
249 | 257 | | |||
250 | QByteArray PopplerSignatureInfo::signature() const | 258 | QByteArray PopplerSignatureInfo::signature() const | ||
251 | { | 259 | { | ||
260 | #ifdef HAVE_POPPLER_0_58 | ||||
252 | return m_info.signature(); | 261 | return m_info.signature(); | ||
262 | #else | ||||
263 | return {}; | ||||
264 | #endif | ||||
253 | } | 265 | } | ||
254 | 266 | | |||
255 | QList<qint64> PopplerSignatureInfo::signedRangeBounds() const | 267 | QList<qint64> PopplerSignatureInfo::signedRangeBounds() const | ||
256 | { | 268 | { | ||
269 | #ifdef HAVE_POPPLER_0_58 | ||||
257 | return m_info.signedRangeBounds(); | 270 | return m_info.signedRangeBounds(); | ||
271 | #else | ||||
272 | return {}; | ||||
273 | #endif | ||||
258 | } | 274 | } | ||
259 | 275 | | |||
260 | bool PopplerSignatureInfo::signsTotalDocument() const | 276 | bool PopplerSignatureInfo::signsTotalDocument() const | ||
261 | { | 277 | { | ||
278 | #ifdef HAVE_POPPLER_0_58 | ||||
262 | return m_info.signsTotalDocument(); | 279 | return m_info.signsTotalDocument(); | ||
280 | #else | ||||
281 | return false; | ||||
282 | #endif | ||||
263 | } | 283 | } | ||
264 | 284 | | |||
265 | const Okular::CertificateInfo &PopplerSignatureInfo::certificateInfo() const | 285 | const Okular::CertificateInfo &PopplerSignatureInfo::certificateInfo() const | ||
266 | { | 286 | { | ||
267 | return *m_certfiticateInfo; | 287 | return *m_certfiticateInfo; | ||
268 | } | 288 | } | ||
269 | 289 | | |||
270 | #endif | 290 | #endif |