Poppler Qt6 26.10.90
poppler-form.h
1/* poppler-form.h: qt interface to poppler
2 * Copyright (C) 2007-2008, Pino Toscano <pino@kde.org>
3 * Copyright (C) 2008, 2011, 2016, 2017, 2019-2022, Albert Astals Cid <aacid@kde.org>
4 * Copyright (C) 2012, Adam Reichold <adamreichold@myopera.com>
5 * Copyright (C) 2016, Hanno Meyer-Thurow <h.mth@web.de>
6 * Copyright (C) 2017, Hans-Ulrich Jüttner <huj@froreich-bioscientia.de>
7 * Copyright (C) 2017, Tobias C. Berner <tcberner@freebsd.org>
8 * Copyright (C) 2018, Andre Heinecke <aheinecke@intevation.de>
9 * Copyright (C) 2018, Chinmoy Ranjan Pradhan <chinmoyrp65@protonmail.com>
10 * Copyright (C) 2018, 2021 Oliver Sander <oliver.sander@tu-dresden.de>
11 * Copyright (C) 2019 João Netto <joaonetto901@gmail.com>
12 * Copyright (C) 2019, Adrian Johnson <ajohnson@redneon.com>
13 * Copyright (C) 2020, Thorsten Behrens <Thorsten.Behrens@CIB.de>
14 * Copyright (C) 2020, Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by Technische Universität Dresden
15 * Copyright (C) 2021, Theofilos Intzoglou <int.teo@gmail.com>
16 * Copyright (C) 2023-2026, g10 Code GmbH, Author: Sune Stolborg Vuorela <sune@vuorela.dk>
17 * Copyright (C) 2024, Pratham Gandhi <ppg.1382@gmail.com>
18 * Copyright (C) 2026, Sune Stolborg Vuorela <sune@vuorela.dk>, work sponsored by the Direction Interministérielle du Numérique
19 *
20 * This program is free software; you can redistribute it and/or modify
21 * it under the terms of the GNU General Public License as published by
22 * the Free Software Foundation; either version 2, or (at your option)
23 * any later version.
24 *
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 * GNU General Public License for more details.
29 *
30 * You should have received a copy of the GNU General Public License
31 * along with this program; if not, write to the Free Software
32 * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
33 */
34
35#ifndef _POPPLER_QT6_FORM_H_
36#define _POPPLER_QT6_FORM_H_
37
38#include <functional>
39#include <memory>
40#include <ctime>
41#include <optional>
42#include <QtCore/QDateTime>
43#include <QtCore/QVector>
44#include <QtCore/QList>
45#include <QtCore/QRectF>
46#include <QtCore/QStringList>
47#include <QtCore/QSharedPointer>
48#include "poppler-export.h"
49#include "poppler-annotation.h"
50#include "poppler-qt6.h"
51
52class Object;
53class Page;
54class FormWidget;
55class FormWidgetButton;
56class FormWidgetText;
57class FormWidgetChoice;
58class FormWidgetSignature;
59
60namespace Poppler {
61
62class DocumentData;
63class Link;
64
65class FormFieldData;
66class FormFieldIconData;
67
71
72class POPPLER_QT6_EXPORT FormFieldIcon
73{
74
75 friend class FormFieldIconData;
76
77public:
78 explicit FormFieldIcon(FormFieldIconData *data);
79 FormFieldIcon(const FormFieldIcon &ffIcon);
80 ~FormFieldIcon();
81
82 FormFieldIcon &operator=(const FormFieldIcon &ffIcon);
83
84private:
85 FormFieldIconData *d_ptr;
86};
87
90class POPPLER_QT6_EXPORT FormField
91{
92
93 friend class FormFieldData;
94
95public:
106
107 virtual ~FormField();
108
112 virtual FormType type() const = 0;
113
118 QRectF rect() const;
119
123 int id() const;
124
128 QString name() const;
129
133 void setName(const QString &name) const;
134
138 QString fullyQualifiedName() const;
139
144 QString uiName() const;
145
149 bool isReadOnly() const;
150
154 void setReadOnly(bool value);
155
159 bool isVisible() const;
160
164 void setVisible(bool value);
165
169 bool isPrintable() const;
170
174 void setPrintable(bool value);
175
181 std::unique_ptr<Link> activationAction() const;
182
193
196 std::unique_ptr<Link> additionalAction(AdditionalActionType type) const;
197
202
203protected:
205 explicit FormField(std::unique_ptr<FormFieldData> dd);
206
207 std::unique_ptr<FormFieldData> m_formData;
209
210private:
211 Q_DISABLE_COPY(FormField)
212};
213
217class POPPLER_QT6_EXPORT FormFieldButton : public FormField
218{
219public:
229
231 FormFieldButton(DocumentData *doc, ::Page *p, ::FormWidgetButton *w);
234
235 FormType type() const override;
236
241
245 QString caption() const;
246
251
257
261 bool state() const;
262
266 void setState(bool state);
267
274 QList<int> siblings() const;
275
276private:
277 Q_DISABLE_COPY(FormFieldButton)
278};
279
283class POPPLER_QT6_EXPORT FormFieldText : public FormField
284{
285public:
295
297 FormFieldText(DocumentData *doc, ::Page *p, ::FormWidgetText *w);
299 ~FormFieldText() override;
300
301 FormType type() const override;
302
307
311 QString text() const;
312
317 void setText(const QString &text);
318
323 void setAppearanceText(const QString &text);
324
331 bool isPassword() const;
332
336 bool isRichText() const;
337
341 int maximumLength() const;
342
346 Qt::Alignment textAlignment() const;
347
352 bool canBeSpellChecked() const;
353
357 double getFontSize() const;
358
362 void setFontSize(int fontSize);
363
364private:
365 Q_DISABLE_COPY(FormFieldText)
366};
367
371class POPPLER_QT6_EXPORT FormFieldChoice : public FormField
372{
373public:
382
384 FormFieldChoice(DocumentData *doc, ::Page *p, ::FormWidgetChoice *w);
387
388 FormType type() const override;
389
394
398 QStringList choices() const;
399
405 QVector<QPair<QString, QString>> choicesWithExportValues() const;
406
413 bool isEditable() const;
414
421 bool multiSelect() const;
422
426 QList<int> currentChoices() const;
427
431 void setCurrentChoices(const QList<int> &choice);
432
436 QString editChoice() const;
437
441 void setEditChoice(const QString &text);
442
446 Qt::Alignment textAlignment() const;
447
454 bool canBeSpellChecked() const;
455
462 void setAppearanceChoiceText(const QString &text);
463
464private:
465 Q_DISABLE_COPY(FormFieldChoice)
466};
467
471class CertificateInfoPrivate;
472class POPPLER_QT6_EXPORT CertificateInfo
473{
474public:
479 {
480 RsaKey,
481 DsaKey,
482 EcKey,
483 OtherKey
484 };
485
490 {
491 KuDigitalSignature = 0x80,
492 KuNonRepudiation = 0x40,
493 KuKeyEncipherment = 0x20,
494 KuDataEncipherment = 0x10,
495 KuKeyAgreement = 0x08,
496 KuKeyCertSign = 0x04,
497 KuClrSign = 0x02,
498 KuEncipherOnly = 0x01,
499 KuNone = 0x00
500 };
502
503
506 enum EntityInfoKey
507 {
508 CommonName,
509 DistinguishedName,
510 EmailAddress,
511 Organization,
512 };
513
520 {
521 X509,
522 PGP
523 };
524
535 enum class KeyLocation
536 {
537 Unknown,
538 Other,
539 Computer,
540 HardwareToken
541 };
542
544 explicit CertificateInfo(CertificateInfoPrivate *priv);
546
550 bool isNull() const;
551
555 int version() const;
556
560 QByteArray serialNumber() const;
561
565 QString issuerInfo(EntityInfoKey key) const;
566
570 QString subjectInfo(EntityInfoKey key) const;
571
577 QString nickName() const;
578
582 QDateTime validityStart() const;
583
587 QDateTime validityEnd() const;
588
592 KeyUsageExtensions keyUsageExtensions() const;
593
602 POPPLER_QT6_DEPRECATED QByteArray publicKey() const;
603
608
612 int publicKeyStrength() const;
613
617 bool isSelfSigned() const;
618
624 bool isQualified() const;
625
632
636 QByteArray certificateData() const;
637
643 bool checkPassword(const QString &password) const;
644
651
661 QVector<SMimeSignatureType> supportedSMimeSignatureTypes() const;
662
663 CertificateInfo(const CertificateInfo &other);
664 CertificateInfo &operator=(const CertificateInfo &other);
665
666private:
667 Q_DECLARE_PRIVATE(CertificateInfo)
668
669 QSharedPointer<CertificateInfoPrivate> d_ptr;
670};
671Q_DECLARE_OPERATORS_FOR_FLAGS(CertificateInfo::KeyUsageExtensions)
672
673
676class SignatureValidationInfoPrivate;
677class POPPLER_QT6_EXPORT SignatureValidationInfo
678{
679public:
693
708
713 {
714 HashAlgorithmUnknown,
715 HashAlgorithmMd2,
716 HashAlgorithmMd5,
717 HashAlgorithmSha1,
718 HashAlgorithmSha256,
719 HashAlgorithmSha384,
720 HashAlgorithmSha512,
721 HashAlgorithmSha224
722 };
723
725 explicit SignatureValidationInfo(SignatureValidationInfoPrivate *priv);
728
733
738
742 QString signerName() const;
743
747 QString signerSubjectDN() const;
748
752 QString location() const;
753
757 QString reason() const;
758
763
767 time_t signingTime() const;
768
772 QByteArray signature() const;
773
777 QList<qint64> signedRangeBounds() const;
778
783 bool signsTotalDocument() const;
784
789
790 SignatureValidationInfo(const SignatureValidationInfo &other);
791 SignatureValidationInfo &operator=(const SignatureValidationInfo &other);
792
793private:
794 Q_DECLARE_PRIVATE(SignatureValidationInfo)
795 friend class FormFieldSignature;
796 QSharedPointer<SignatureValidationInfoPrivate> d_ptr;
797};
798
804class AsyncObjectPrivate;
805class POPPLER_QT6_EXPORT AsyncObject : public QObject // clazy:exclude=ctor-missing-parent-argument
806{
807 Q_OBJECT
808public:
809 /* Constructor. On purpose not having a QObject parameter
810 It will be returned by shared_ptr or unique_ptr
811 */
812 AsyncObject();
813 ~AsyncObject() override;
814Q_SIGNALS:
815 void done();
816
817private:
818 std::unique_ptr<AsyncObjectPrivate> d;
819};
820
824class POPPLER_QT6_EXPORT FormFieldSignature : public FormField
825{
826public:
831 {
832 UnknownSignatureType,
833 AdbePkcs7sha1,
834 AdbePkcs7detached,
835 EtsiCAdESdetached,
838 };
839
850
852 FormFieldSignature(DocumentData *doc, ::Page *p, ::FormWidgetSignature *w);
855
856 FormType type() const override;
857
862
876 POPPLER_QT6_DEPRECATED SignatureValidationInfo validate(ValidateOptions opt) const;
877
891 POPPLER_QT6_DEPRECATED SignatureValidationInfo validate(int opt, const QDateTime &validationTime) const;
892
910 std::pair<SignatureValidationInfo, std::shared_ptr<AsyncObject>> validateAsync(ValidateOptions opt, const QDateTime &validationTime = {}) const;
911
920
939
947 SigningResult sign(const QString &outputFileName, const PDFConverter::NewSignatureData &data) const;
948
954
955 ErrorString lastSigningErrorDetails() const;
956
957private:
958 Q_DISABLE_COPY(FormFieldSignature)
959};
960
966{
967 NSS,
968 GPG
969};
970
976QVector<CryptoSignBackend> POPPLER_QT6_EXPORT availableCryptoSignBackends();
977
985std::optional<CryptoSignBackend> POPPLER_QT6_EXPORT activeCryptoSignBackend();
986
994bool POPPLER_QT6_EXPORT setActiveCryptoSignBackend(CryptoSignBackend backend);
995
1002
1011
1019bool POPPLER_QT6_DEPRECATED POPPLER_QT6_EXPORT hasNSSSupport();
1020
1026QVector<CertificateInfo> POPPLER_QT6_EXPORT getAvailableSigningCertificates();
1027
1033QString POPPLER_QT6_EXPORT getNSSDir();
1034
1040void POPPLER_QT6_EXPORT setNSSDir(const QString &pathURL);
1041
1047void POPPLER_QT6_EXPORT setNSSPasswordCallback(const std::function<char *(const char *)> &f);
1048
1057void POPPLER_QT6_EXPORT setPgpSignaturesAllowed(bool allowed);
1058
1064bool POPPLER_QT6_EXPORT arePgpSignaturesAllowed();
1065}
1066
1067#endif
AdditionalActionType
Describes the flags from an annotations 'AA' dictionary.
Definition poppler-annotation.h:441
Definition poppler-form.h:473
POPPLER_QT6_DEPRECATED QByteArray publicKey() const
The raw public key value, though it might also be empty depending on the signature types involved.
PublicKeyType publicKeyType() const
The public key type.
bool isSelfSigned() const
Returns true if certificate is self-signed otherwise returns false.
QByteArray certificateData() const
The DER encoded certificate.
QString issuerInfo(EntityInfoKey key) const
Information about the issuer.
CertificateType certificateType() const
QString subjectInfo(EntityInfoKey key) const
Information about the subject.
CertificateType
The type of the certificate.
Definition poppler-form.h:520
KeyLocation keyLocation() const
The storage location for this key.
bool checkPassword(const QString &password) const
Checks if the given password is the correct one for this certificate.
int version() const
The certificate version string.
int publicKeyStrength() const
The strength of public key in bits.
bool isQualified() const
Can be used to do qualified electronic signatures (legally binding).
bool isNull() const
Returns true if certificate has no contents; otherwise returns false.
Q_DECLARE_FLAGS(KeyUsageExtensions, KeyUsageExtension) enum EntityInfoKey
Predefined keys for elements in an entity's distinguished name.
Definition poppler-form.h:501
QDateTime validityEnd() const
The date-time when certificate expires.
QByteArray serialNumber() const
The certificate serial number.
QVector< SMimeSignatureType > supportedSMimeSignatureTypes() const
The various s/mime signature types that this certificate might succeed in making.
KeyUsageExtension
Certificate key usage extensions.
Definition poppler-form.h:490
PublicKeyType
The algorithm of public key.
Definition poppler-form.h:479
KeyUsageExtensions keyUsageExtensions() const
The uses allowed for the certificate.
QDateTime validityStart() const
The date-time when certificate becomes valid.
KeyLocation
A signing key can be located in different places sometimes.
Definition poppler-form.h:536
QString nickName() const
The certificate internal database nickname.
A form field that represents a "button".
Definition poppler-form.h:218
ButtonType buttonType() const
The particular type of the button field.
QString caption() const
The caption to be used for the button.
void setIcon(const FormFieldIcon &icon)
Sets a new icon for the button, it has to be a icon returned by FormFieldButton::icon.
QList< int > siblings() const
The list with the IDs of siblings (ie, buttons belonging to the same group as the current one.
~FormFieldButton() override
*‍/
FormType type() const override
The type of the field.
void setState(bool state)
Sets the state of the button to the new state .
FormFieldIcon icon() const
Gets the icon used by the button.
ButtonType
The types of button field.
Definition poppler-form.h:224
@ CheckBox
A check box.
Definition poppler-form.h:226
@ Radio
A radio button.
Definition poppler-form.h:227
@ Push
A simple push button.
Definition poppler-form.h:225
bool state() const
The state of the button.
A form field that represents a choice field.
Definition poppler-form.h:372
bool canBeSpellChecked() const
Whether the text inserted manually in the field (where possible) can be spell-checked.
~FormFieldChoice() override
*‍/
ChoiceType
The particular type of this choice field.
Definition poppler-form.h:378
@ ListBox
A multiline text field.
Definition poppler-form.h:380
@ ComboBox
A simple singleline text field.
Definition poppler-form.h:379
QVector< QPair< QString, QString > > choicesWithExportValues() const
The possible choices of the choice field.
ChoiceType choiceType() const
The choice type of the choice field.
bool multiSelect() const
Whether more than one choice of this FormFieldChoice::ListBox can be selected at the same time.
QList< int > currentChoices() const
The currently selected choices.
void setEditChoice(const QString &text)
Sets the text entered into an editable combo box choice field.
QString editChoice() const
The text entered into an editable combo box choice field.
void setCurrentChoices(const QList< int > &choice)
Sets the selected choices to choice.
void setAppearanceChoiceText(const QString &text)
Sets the text inside the Appearance Stream to the specified text.
Qt::Alignment textAlignment() const
The horizontal alignment for the text of this text field.
FormType type() const override
The type of the field.
QStringList choices() const
The possible choices of the choice field.
bool isEditable() const
Whether this FormFieldChoice::ComboBox is editable, i.e.
The class containing the appearance information.
Definition poppler-form.h:73
A form field that represents a signature.
Definition poppler-form.h:825
std::pair< SignatureValidationInfo, std::shared_ptr< AsyncObject > > validateAsync(ValidateOptions opt, const QDateTime &validationTime={}) const
Validate the signature with validationTime as validation time.
SigningResult sign(const QString &outputFileName, const PDFConverter::NewSignatureData &data) const
Signs a field of UnsignedSignature type.
FormType type() const override
The type of the field.
SignatureType signatureType() const
The signature type.
SignatureType
The types of signature fields.
Definition poppler-form.h:831
@ G10cPgpSignatureDetached
nonstandardized signature type
Definition poppler-form.h:837
@ UnsignedSignature
Definition poppler-form.h:836
POPPLER_QT6_DEPRECATED SignatureValidationInfo validate(int opt, const QDateTime &validationTime) const
Validate the signature with validationTime as validation time.
SigningResult
For consumers, this enum will be extended.
Definition poppler-form.h:928
@ WriteFailed
Write failed (permissions, faulty disk, ...).
Definition poppler-form.h:934
@ InternalError
Unexpected error, likely a bug in poppler.
Definition poppler-form.h:932
@ KeyMissing
Key not found (Either the input key is not from the list or the available keys has changed underneath...
Definition poppler-form.h:933
@ FieldAlreadySigned
Trying to sign a field that is already signed.
Definition poppler-form.h:929
@ SigningSuccess
No error.
Definition poppler-form.h:931
@ BadPassphrase
Passphrase didn't work.
Definition poppler-form.h:936
@ GenericSigningError
Unclassified error.
Definition poppler-form.h:930
@ UnsupportedSignatureType
User asked for a signature type that the current backend/key combo can't deliver.
Definition poppler-form.h:937
@ UserCancelled
User cancelled the process.
Definition poppler-form.h:935
ValidateOptions
The validation options of this signature.
Definition poppler-form.h:844
@ ValidateWithoutOCSPRevocationCheck
Do not contact OCSP servers to check for certificate revocation status.
Definition poppler-form.h:847
@ ValidateUseAIACertFetch
Use the AIA extension for certificate fetching.
Definition poppler-form.h:848
@ ValidateForceRevalidation
Force revalidation of the certificate.
Definition poppler-form.h:846
@ ValidateVerifyCertificate
Validate the certificate.
Definition poppler-form.h:845
~FormFieldSignature() override
*‍/
POPPLER_QT6_DEPRECATED SignatureValidationInfo validate(ValidateOptions opt) const
Validate the signature with now as validation time.
ErrorString lastSigningErrorDetails() const
A string with a string that might offer more details of the signing result failure.
SignatureValidationInfo::CertificateStatus validateResult() const
A form field that represents a text input.
Definition poppler-form.h:284
void setAppearanceText(const QString &text)
Sets the text inside the Appearance Stream to the specified text.
TextType
The particular type of this text field.
Definition poppler-form.h:290
@ Multiline
A multiline text field.
Definition poppler-form.h:292
@ Normal
A simple singleline text field.
Definition poppler-form.h:291
@ FileSelect
An input field to select the path of a file on disk.
Definition poppler-form.h:293
void setText(const QString &text)
Sets the text associated with the text field to the specified text.
QString text() const
The text associated with the text field.
double getFontSize() const
The font size of the text in the form field.
void setFontSize(int fontSize)
Set the font size of the text in the form field (currently only as integer).
~FormFieldText() override
*‍/
bool canBeSpellChecked() const
Whether the text inserted manually in the field (where possible) can be spell-checked.
bool isPassword() const
Whether this text field is a password input, eg its text must be replaced with asterisks.
TextType textType() const
The text type of the text field.
Qt::Alignment textAlignment() const
The horizontal alignment for the text of this text field.
FormType type() const override
The type of the field.
int maximumLength() const
The maximum length for the text of this field, or -1 if not set.
bool isRichText() const
Whether this text field should allow rich text.
The base class representing a form field.
Definition poppler-form.h:91
bool isPrintable() const
Whether this field is printable.
std::unique_ptr< Link > activationAction() const
The activation action of this form field.
int id() const
The ID of the field.
QString name() const
The internal name (T) of the field.
void setVisible(bool value)
Set whether this form field is visible.
bool isVisible() const
Whether this form field is visible.
std::unique_ptr< Link > additionalAction(AdditionalActionType type) const
Returns a given form additional action.
void setReadOnly(bool value)
Set whether this form field is read-only.
void setPrintable(bool value)
Set whether this field is printable.
std::unique_ptr< Link > additionalAction(Annotation::AdditionalActionType type) const
Returns a given widget annotation additional action.
QRectF rect() const
bool isReadOnly() const
Whether this form field is read-only.
QString fullyQualifiedName() const
The internal fully qualified name of the field.
QString uiName() const
The name of the field to be used in user interface (eg messages to the user).
void setName(const QString &name) const
Sets the internal name (T) of the field.
virtual FormType type() const =0
The type of the field.
AdditionalActionType
Describes the flags from the form 'AA' dictionary.
Definition poppler-form.h:187
@ CalculateField
A JavaScript action to be performed when the field needs to be recalculated.
Definition poppler-form.h:191
@ FormatField
A JavaScript action to be performed before the field is formatted to display its value.
Definition poppler-form.h:189
@ ValidateField
A JavaScript action to be performed when the field value changes.
Definition poppler-form.h:190
@ FieldModified
A JavaScript action to be performed when the user modifies the field.
Definition poppler-form.h:188
FormType
The different types of form field.
Definition poppler-form.h:100
@ FormButton
A button field. See ButtonType.
Definition poppler-form.h:101
@ FormSignature
A signature field.
Definition poppler-form.h:104
@ FormText
A text field. See TextType.
Definition poppler-form.h:102
@ FormChoice
A single choice field. See ChoiceType.
Definition poppler-form.h:103
A page in a document.
Definition poppler-qt6.h:426
Definition poppler-form.h:678
QString signerName() const
The signer name associated with the signature.
QList< qint64 > signedRangeBounds() const
Get the bounds of the ranges of the document which are signed.
QByteArray signature() const
Get the signature binary data.
HashAlgorithm hashAlgorithm() const
The hash algorithm used for the signature.
bool signsTotalDocument() const
Checks whether the signature authenticates the total document except for the signature itself.
CertificateInfo certificateInfo() const
The signer certificate info.
CertificateStatus
The verification result of the certificate.
Definition poppler-form.h:698
@ CertificateVerificationInProgress
The certificate is not yet verified but is in progress in the background. See validateAsync.
Definition poppler-form.h:706
@ CertificateUntrustedIssuer
The issuer of this certificate has been marked as untrusted by the user.
Definition poppler-form.h:700
@ CertificateUnknownIssuer
The certificate trust chain has not finished in a trusted root certificate.
Definition poppler-form.h:701
@ CertificateGenericError
The certificate could not be verified.
Definition poppler-form.h:704
@ CertificateRevoked
The certificate was revoked by the issuing certificate authority.
Definition poppler-form.h:702
@ CertificateTrusted
The certificate is considered trusted.
Definition poppler-form.h:699
@ CertificateNotVerified
The certificate is not yet verified.
Definition poppler-form.h:705
@ CertificateExpired
The signing time is outside the validity bounds of this certificate.
Definition poppler-form.h:703
HashAlgorithm
The hash algorithm of the signature.
Definition poppler-form.h:713
time_t signingTime() const
The signing time associated with the signature.
SignatureStatus
The verification result of the signature.
Definition poppler-form.h:684
@ SignatureNotVerified
The signature is not yet verified.
Definition poppler-form.h:691
@ SignatureDigestMismatch
The document content was changed after the signature was applied.
Definition poppler-form.h:687
@ SignatureGenericError
The signature could not be verified.
Definition poppler-form.h:689
@ SignatureDecodingError
The signature CMS/PKCS7 structure is malformed.
Definition poppler-form.h:688
@ SignatureValid
The signature is cryptographically valid.
Definition poppler-form.h:685
@ SignatureNotFound
The requested signature is not present in the document.
Definition poppler-form.h:690
@ SignatureInvalid
The signature is cryptographically invalid.
Definition poppler-form.h:686
SignatureStatus signatureStatus() const
The signature status of the signature.
QString signerSubjectDN() const
The signer subject distinguished name associated with the signature.
QString reason() const
Get signing reason.
CertificateStatus certificateStatus() const
The certificate status of the signature.
QString location() const
Get signing location.
The Poppler Qt6 binding.
Definition poppler-annotation.h:54
bool POPPLER_QT6_DEPRECATED POPPLER_QT6_EXPORT hasNSSSupport()
Returns is poppler was compiled with NSS support.
std::optional< CryptoSignBackend > POPPLER_QT6_EXPORT activeCryptoSignBackend()
Returns current active backend or nullopt if none is active.
bool POPPLER_QT6_EXPORT hasCryptoSignBackendFeature(CryptoSignBackend backend, CryptoSignBackendFeature feature)
Queries if a backend supports or not supports a given feature.
QVector< CertificateInfo > POPPLER_QT6_EXPORT getAvailableSigningCertificates()
Return vector of suitable signing certificates.
QVector< CryptoSignBackend > POPPLER_QT6_EXPORT availableCryptoSignBackends()
The available compiled-in backends.
QString POPPLER_QT6_EXPORT getNSSDir()
Gets the current NSS CertDB directory.
bool POPPLER_QT6_EXPORT arePgpSignaturesAllowed()
void POPPLER_QT6_EXPORT setPgpSignaturesAllowed(bool allowed)
Allow pgp signatures in pdf files (standard-extension, experimental) Not supported for NSS backend.
Q_DECLARE_OPERATORS_FOR_FLAGS(CertificateInfo::KeyUsageExtensions) class SignatureValidationInfoPrivate
A signature validation info helper class.
CryptoSignBackend
Possible compiled in backends for signature handling.
Definition poppler-form.h:966
CryptoSignBackendFeature
Definition poppler-form.h:997
@ BackendAsksPassphrase
If the backend itself out of band requests passwords or if the host applicaion somehow must do it.
Definition poppler-form.h:1000
void POPPLER_QT6_EXPORT setNSSDir(const QString &pathURL)
Set a custom NSS CertDB directory.
bool POPPLER_QT6_EXPORT setActiveCryptoSignBackend(CryptoSignBackend backend)
Sets active backend.
void POPPLER_QT6_EXPORT setNSSPasswordCallback(const std::function< char *(const char *)> &f)
Sets the callback for NSS password requests.