File indexing completed on 2026-01-07 10:14:53
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 #ifndef SIGNATUREINFO_H
0021 #define SIGNATUREINFO_H
0022
0023 #include <memory>
0024 #include <ctime>
0025
0026 #include "poppler_private_export.h"
0027 #include "goo/GooString.h"
0028 #include "HashAlgorithm.h"
0029
0030 enum SignatureValidationStatus
0031 {
0032 SIGNATURE_VALID,
0033 SIGNATURE_INVALID,
0034 SIGNATURE_DIGEST_MISMATCH,
0035 SIGNATURE_DECODING_ERROR,
0036 SIGNATURE_GENERIC_ERROR,
0037 SIGNATURE_NOT_FOUND,
0038 SIGNATURE_NOT_VERIFIED
0039 };
0040
0041 enum CertificateValidationStatus
0042 {
0043 CERTIFICATE_TRUSTED,
0044 CERTIFICATE_UNTRUSTED_ISSUER,
0045 CERTIFICATE_UNKNOWN_ISSUER,
0046 CERTIFICATE_REVOKED,
0047 CERTIFICATE_EXPIRED,
0048 CERTIFICATE_GENERIC_ERROR,
0049 CERTIFICATE_NOT_VERIFIED
0050 };
0051
0052 class X509CertificateInfo;
0053
0054 class POPPLER_PRIVATE_EXPORT SignatureInfo
0055 {
0056 public:
0057 SignatureInfo();
0058 ~SignatureInfo();
0059
0060 SignatureInfo(const SignatureInfo &) = delete;
0061 SignatureInfo &operator=(const SignatureInfo &) = delete;
0062
0063
0064 SignatureValidationStatus getSignatureValStatus() const;
0065 std::string getSignerName() const;
0066 std::string getSubjectDN() const;
0067 const GooString &getLocation() const;
0068 const GooString &getReason() const;
0069 HashAlgorithm getHashAlgorithm() const;
0070 time_t getSigningTime() const;
0071 bool isSubfilterSupported() const { return sig_subfilter_supported; }
0072 const X509CertificateInfo *getCertificateInfo() const;
0073
0074
0075 void setSignatureValStatus(enum SignatureValidationStatus);
0076 void setSignerName(const std::string &);
0077 void setSubjectDN(const std::string &);
0078 void setLocation(const GooString *);
0079 void setReason(const GooString *);
0080 void setHashAlgorithm(HashAlgorithm);
0081 void setSigningTime(time_t);
0082 void setSubFilterSupport(bool isSupported) { sig_subfilter_supported = isSupported; }
0083 void setCertificateInfo(std::unique_ptr<X509CertificateInfo>);
0084
0085 private:
0086 SignatureValidationStatus sig_status = SIGNATURE_NOT_VERIFIED;
0087 std::unique_ptr<X509CertificateInfo> cert_info;
0088 std::string signer_name;
0089 std::string subject_dn;
0090 GooString location;
0091 GooString reason;
0092 HashAlgorithm hash_type = HashAlgorithm::Unknown;
0093 time_t signing_time = 0;
0094 bool sig_subfilter_supported = false;
0095 };
0096
0097 #endif