Okular

signatureutils.cpp
1 /*
2  SPDX-FileCopyrightText: 2018 Chinmoy Ranjan Pradhan <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #include "signatureutils.h"
8 
9 using namespace Okular;
10 
11 CertificateInfo::CertificateInfo()
12 {
13 }
14 
16 {
17 }
18 
19 Q_DECLARE_OPERATORS_FOR_FLAGS(CertificateInfo::KeyUsageExtensions)
20 
21 bool CertificateInfo::isNull() const
22 {
23  return true;
24 }
25 
27 {
28  return -1;
29 }
30 
32 {
33  return QByteArray();
34 }
35 
37 {
38  return QString();
39 }
40 
42 {
43  return QString();
44 }
45 
47 {
48  return QString();
49 }
50 
52 {
53  return QDateTime();
54 }
55 
57 {
58  return QDateTime();
59 }
60 
61 CertificateInfo::KeyUsageExtensions CertificateInfo::keyUsageExtensions() const
62 {
63  return KuNone;
64 }
65 
67 {
68  return QByteArray();
69 }
70 
72 {
73  return OtherKey;
74 }
75 
77 {
78  return -1;
79 }
80 
82 {
83  return false;
84 }
85 
87 {
88  return QByteArray();
89 }
90 
91 bool CertificateInfo::checkPassword(const QString & /*password*/) const
92 {
93  return false;
94 }
95 
96 SignatureInfo::SignatureInfo()
97 {
98 }
99 
101 {
102 }
103 
105 {
106  return SignatureStatusUnknown;
107 }
108 
110 {
112 }
113 
115 {
116  return HashAlgorithmUnknown;
117 }
118 
120 {
121  return QString();
122 }
123 
125 {
126  return QString();
127 }
128 
130 {
131  return QString();
132 }
133 
135 {
136  return QString();
137 }
138 
140 {
141  return QDateTime();
142 }
143 
145 {
146  return QByteArray();
147 }
148 
150 {
151  return QList<qint64>();
152 }
153 
155 {
156  return false;
157 }
158 
160 {
161  static CertificateInfo dummy;
162  return dummy;
163 }
164 
165 CertificateStore::CertificateStore()
166 {
167 }
168 
170 {
171 }
172 
174 {
175  *userCancelled = false;
176  return QList<CertificateInfo *>();
177 }
178 
179 QList<CertificateInfo *> CertificateStore::signingCertificatesForNow(bool *userCancelled, bool *nonDateValidCerts) const
180 {
183  auto it = certs.begin();
184  *nonDateValidCerts = false;
185  while (it != certs.end()) {
186  if ((*it)->validityStart() > now || now > (*it)->validityEnd()) {
187  it = certs.erase(it);
188  *nonDateValidCerts = true;
189  } else {
190  ++it;
191  }
192  }
193  return certs;
194 }
virtual QDateTime validityEnd() const
The date-time when certificate expires.
A helper class to store information about x509 certificate.
virtual QString subjectInfo(EntityInfoKey key) const
Information about the subject.
virtual QByteArray publicKey() const
The public key value.
virtual QDateTime signingTime() const
The signing time associated with the signature.
The documentation to the global Okular namespace.
Definition: action.h:16
virtual QString location() const
Get signing location.
virtual PublicKeyType publicKeyType() const
The public key type.
QDateTime currentDateTime()
virtual QByteArray signature() const
Get the signature binary data.
@ SignatureStatusUnknown
The signature status is unknown for some reason.
virtual QString signerSubjectDN() const
The signer subject distinguished name associated with the signature.
virtual bool isSelfSigned() const
Returns true if certificate is self-signed otherwise returns false.
PublicKeyType
The algorithm of public key.
virtual const CertificateInfo & certificateInfo() const
Get certificate details.
virtual QByteArray certificateData() const
The DER encoded certificate.
CertificateStatus
The verification result of the certificate.
QList< CertificateInfo * > signingCertificatesForNow(bool *userCancelled, bool *nonDateValidCerts) const
Returns list of valid, usable signing certificates for current date and time.
virtual HashAlgorithm hashAlgorithm() const
The hash algorithm used for the signature.
virtual bool checkPassword(const QString &password) const
Checks if the given password is the correct one for this certificate.
@ CertificateStatusUnknown
The certificate status is unknown for some reason.
virtual CertificateStatus certificateStatus() const
The certificate status of the signature.
virtual bool signsTotalDocument() const
Checks whether the signature authenticates the total document except for the signature itself.
virtual int publicKeyStrength() const
The strength of public key in bits.
SignatureStatus
The verification result of the signature.
virtual int version() const
The certificate version string.
virtual ~CertificateStore()
Destructor.
virtual QByteArray serialNumber() const
The certificate serial number.
virtual QList< CertificateInfo * > signingCertificates(bool *userCancelled) const
Returns list of valid, usable signing certificates.
HashAlgorithm
The hash algorithm of the signature.
EntityInfoKey
Predefined keys for elements in an entity's distinguished name.
virtual QString issuerInfo(EntityInfoKey key) const
Information about the issuer.
virtual QString reason() const
Get signing reason.
virtual QDateTime validityStart() const
The date-time when certificate becomes valid.
QList::iterator erase(QList::iterator pos)
virtual QList< qint64 > signedRangeBounds() const
Get the bounds of the ranges of the document which are signed.
virtual QString nickName() const
The certificate internal database nickname.
QList::iterator begin()
virtual ~CertificateInfo()
Destructor.
virtual SignatureStatus signatureStatus() const
The signature status of the signature.
virtual QString signerName() const
The signer subject common name associated with the signature.
QList::iterator end()
virtual ~SignatureInfo()
Destructor.
virtual KeyUsageExtensions keyUsageExtensions() const
The uses allowed for the certificate.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Mar 27 2023 04:09:00 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.