2021-05-24 07:25:56 +00:00
|
|
|
/*
|
|
|
|
SPDX-FileCopyrightText: 2018 Chinmoy Ranjan Pradhan <chinmoyrp65@gmail.com>
|
|
|
|
|
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2019-01-05 22:30:25 +00:00
|
|
|
|
|
|
|
#include "signatureutils.h"
|
2023-05-03 13:41:14 +00:00
|
|
|
#include <KLocalizedString>
|
2019-01-05 22:30:25 +00:00
|
|
|
|
|
|
|
using namespace Okular;
|
2023-05-03 13:41:14 +00:00
|
|
|
|
|
|
|
static QString handleEmpty(const QString &string, CertificateInfo::EmptyString empty)
|
|
|
|
{
|
|
|
|
if (string.isEmpty()) {
|
|
|
|
switch (empty) {
|
|
|
|
case CertificateInfo::EmptyString::Empty:
|
|
|
|
return {};
|
|
|
|
case CertificateInfo::EmptyString::TranslatedNotAvailable:
|
|
|
|
return i18n("Not Available");
|
|
|
|
}
|
|
|
|
return {};
|
|
|
|
}
|
|
|
|
return string;
|
|
|
|
}
|
|
|
|
|
2023-04-21 10:50:46 +00:00
|
|
|
class EntityInfo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
QString commonName;
|
|
|
|
QString distinguishedName;
|
|
|
|
QString emailAddress;
|
|
|
|
QString organization;
|
|
|
|
};
|
|
|
|
class Okular::CertificateInfoPrivate : public QSharedData
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
bool isNull = true;
|
|
|
|
int version = -1;
|
|
|
|
QByteArray serialNumber;
|
|
|
|
EntityInfo issuerInfo;
|
|
|
|
EntityInfo subjectInfo;
|
|
|
|
QString nickName;
|
|
|
|
QDateTime validityStart;
|
|
|
|
QDateTime validityEnd;
|
|
|
|
CertificateInfo::KeyUsageExtensions keyUsageExtensions = CertificateInfo::KuNone;
|
|
|
|
QByteArray publicKey;
|
|
|
|
CertificateInfo::PublicKeyType publicKeyType = CertificateInfo::OtherKey;
|
|
|
|
int publicKeyStrength = -1;
|
|
|
|
bool isSelfSigned = false;
|
|
|
|
QByteArray certificateData;
|
2023-06-25 22:41:22 +00:00
|
|
|
CertificateInfo::Backend backend = CertificateInfo::Backend::Unknown;
|
2023-04-21 10:50:46 +00:00
|
|
|
std::function<bool(QString)> checkPasswordFunction;
|
|
|
|
};
|
2019-01-05 22:30:25 +00:00
|
|
|
|
|
|
|
CertificateInfo::CertificateInfo()
|
2023-04-21 10:50:46 +00:00
|
|
|
: d {new CertificateInfoPrivate()}
|
2019-01-05 22:30:25 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2023-04-21 10:50:46 +00:00
|
|
|
Okular::CertificateInfo::CertificateInfo(const Okular::CertificateInfo &other) = default;
|
|
|
|
Okular::CertificateInfo::CertificateInfo(Okular::CertificateInfo &&other) noexcept = default;
|
|
|
|
Okular::CertificateInfo &Okular::CertificateInfo::operator=(const Okular::CertificateInfo &other) = default;
|
|
|
|
CertificateInfo &Okular::CertificateInfo::operator=(Okular::CertificateInfo &&other) noexcept = default;
|
|
|
|
|
|
|
|
CertificateInfo::~CertificateInfo() = default;
|
2019-01-05 22:30:25 +00:00
|
|
|
|
|
|
|
Q_DECLARE_OPERATORS_FOR_FLAGS(CertificateInfo::KeyUsageExtensions)
|
|
|
|
|
|
|
|
bool CertificateInfo::isNull() const
|
|
|
|
{
|
2023-04-21 10:50:46 +00:00
|
|
|
return d->isNull;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CertificateInfo::setNull(bool isNull)
|
|
|
|
{
|
|
|
|
d->isNull = isNull;
|
2019-01-05 22:30:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int CertificateInfo::version() const
|
|
|
|
{
|
2023-04-21 10:50:46 +00:00
|
|
|
return d->version;
|
|
|
|
}
|
|
|
|
void CertificateInfo::setVersion(int version)
|
|
|
|
{
|
|
|
|
d->version = version;
|
2019-01-05 22:30:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QByteArray CertificateInfo::serialNumber() const
|
|
|
|
{
|
2023-04-21 10:50:46 +00:00
|
|
|
return d->serialNumber;
|
|
|
|
}
|
|
|
|
void CertificateInfo::setSerialNumber(const QByteArray &serialNumber)
|
|
|
|
{
|
|
|
|
d->serialNumber = serialNumber;
|
2019-01-05 22:30:25 +00:00
|
|
|
}
|
|
|
|
|
2023-05-03 13:41:14 +00:00
|
|
|
QString CertificateInfo::issuerInfo(EntityInfoKey key, EmptyString empty) const
|
2019-01-05 22:30:25 +00:00
|
|
|
{
|
2023-04-21 10:50:46 +00:00
|
|
|
switch (key) {
|
|
|
|
case EntityInfoKey::CommonName:
|
2023-05-03 13:41:14 +00:00
|
|
|
return handleEmpty(d->issuerInfo.commonName, empty);
|
2023-04-21 10:50:46 +00:00
|
|
|
case EntityInfoKey::DistinguishedName:
|
2023-05-03 13:41:14 +00:00
|
|
|
return handleEmpty(d->issuerInfo.distinguishedName, empty);
|
2023-04-21 10:50:46 +00:00
|
|
|
case EntityInfoKey::EmailAddress:
|
2023-05-03 13:41:14 +00:00
|
|
|
return handleEmpty(d->issuerInfo.emailAddress, empty);
|
2023-04-21 10:50:46 +00:00
|
|
|
case EntityInfoKey::Organization:
|
2023-05-03 13:41:14 +00:00
|
|
|
return handleEmpty(d->issuerInfo.organization, empty);
|
2023-04-21 10:50:46 +00:00
|
|
|
}
|
2019-01-05 22:30:25 +00:00
|
|
|
return QString();
|
|
|
|
}
|
|
|
|
|
2023-04-21 10:50:46 +00:00
|
|
|
void CertificateInfo::setIssuerInfo(EntityInfoKey key, const QString &value)
|
|
|
|
{
|
|
|
|
switch (key) {
|
|
|
|
case EntityInfoKey::CommonName:
|
|
|
|
d->issuerInfo.commonName = value;
|
|
|
|
return;
|
|
|
|
case EntityInfoKey::DistinguishedName:
|
|
|
|
d->issuerInfo.distinguishedName = value;
|
|
|
|
return;
|
|
|
|
case EntityInfoKey::EmailAddress:
|
|
|
|
d->issuerInfo.emailAddress = value;
|
|
|
|
return;
|
|
|
|
case EntityInfoKey::Organization:
|
|
|
|
d->issuerInfo.organization = value;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-03 13:41:14 +00:00
|
|
|
QString CertificateInfo::subjectInfo(EntityInfoKey key, EmptyString empty) const
|
2019-01-05 22:30:25 +00:00
|
|
|
{
|
2023-04-21 10:50:46 +00:00
|
|
|
switch (key) {
|
|
|
|
case EntityInfoKey::CommonName:
|
2023-05-03 13:41:14 +00:00
|
|
|
return handleEmpty(d->subjectInfo.commonName, empty);
|
2023-04-21 10:50:46 +00:00
|
|
|
case EntityInfoKey::DistinguishedName:
|
2023-05-03 13:41:14 +00:00
|
|
|
return handleEmpty(d->subjectInfo.distinguishedName, empty);
|
2023-04-21 10:50:46 +00:00
|
|
|
case EntityInfoKey::EmailAddress:
|
2023-05-03 13:41:14 +00:00
|
|
|
return handleEmpty(d->subjectInfo.emailAddress, empty);
|
2023-04-21 10:50:46 +00:00
|
|
|
case EntityInfoKey::Organization:
|
2023-05-03 13:41:14 +00:00
|
|
|
return handleEmpty(d->subjectInfo.organization, empty);
|
2023-04-21 10:50:46 +00:00
|
|
|
}
|
2019-01-05 22:30:25 +00:00
|
|
|
return QString();
|
|
|
|
}
|
|
|
|
|
2023-04-21 10:50:46 +00:00
|
|
|
void CertificateInfo::setSubjectInfo(EntityInfoKey key, const QString &value)
|
|
|
|
{
|
|
|
|
switch (key) {
|
|
|
|
case EntityInfoKey::CommonName:
|
|
|
|
d->subjectInfo.commonName = value;
|
|
|
|
return;
|
|
|
|
case EntityInfoKey::DistinguishedName:
|
|
|
|
d->subjectInfo.distinguishedName = value;
|
|
|
|
return;
|
|
|
|
case EntityInfoKey::EmailAddress:
|
|
|
|
d->subjectInfo.emailAddress = value;
|
|
|
|
return;
|
|
|
|
case EntityInfoKey::Organization:
|
|
|
|
d->subjectInfo.organization = value;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-18 14:54:47 +00:00
|
|
|
QString CertificateInfo::nickName() const
|
|
|
|
{
|
2023-04-21 10:50:46 +00:00
|
|
|
return d->nickName;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CertificateInfo::setNickName(const QString &nickName)
|
|
|
|
{
|
|
|
|
d->nickName = nickName;
|
2020-01-18 14:54:47 +00:00
|
|
|
}
|
|
|
|
|
2019-01-05 22:30:25 +00:00
|
|
|
QDateTime CertificateInfo::validityStart() const
|
|
|
|
{
|
2023-04-21 10:50:46 +00:00
|
|
|
return d->validityStart;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CertificateInfo::setValidityStart(const QDateTime &start)
|
|
|
|
{
|
|
|
|
d->validityStart = start;
|
2019-01-05 22:30:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QDateTime CertificateInfo::validityEnd() const
|
|
|
|
{
|
2023-04-21 10:50:46 +00:00
|
|
|
return d->validityEnd;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Okular::CertificateInfo::setValidityEnd(const QDateTime &validityEnd)
|
|
|
|
{
|
|
|
|
d->validityEnd = validityEnd;
|
2019-01-05 22:30:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
CertificateInfo::KeyUsageExtensions CertificateInfo::keyUsageExtensions() const
|
|
|
|
{
|
2023-04-21 10:50:46 +00:00
|
|
|
return d->keyUsageExtensions;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Okular::CertificateInfo::setKeyUsageExtensions(Okular::CertificateInfo::KeyUsageExtensions ext)
|
|
|
|
{
|
|
|
|
d->keyUsageExtensions = ext;
|
2019-01-05 22:30:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QByteArray CertificateInfo::publicKey() const
|
|
|
|
{
|
2023-04-21 10:50:46 +00:00
|
|
|
return d->publicKey;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Okular::CertificateInfo::setPublicKey(const QByteArray &publicKey)
|
|
|
|
{
|
|
|
|
d->publicKey = publicKey;
|
2019-01-05 22:30:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
CertificateInfo::PublicKeyType CertificateInfo::publicKeyType() const
|
|
|
|
{
|
2023-04-21 10:50:46 +00:00
|
|
|
return d->publicKeyType;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CertificateInfo::setPublicKeyType(PublicKeyType type)
|
|
|
|
{
|
|
|
|
d->publicKeyType = type;
|
2019-01-05 22:30:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int CertificateInfo::publicKeyStrength() const
|
|
|
|
{
|
2023-04-21 10:50:46 +00:00
|
|
|
return d->publicKeyStrength;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CertificateInfo::setPublicKeyStrength(int strength)
|
|
|
|
{
|
|
|
|
d->publicKeyStrength = strength;
|
2019-01-05 22:30:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool CertificateInfo::isSelfSigned() const
|
|
|
|
{
|
2023-04-21 10:50:46 +00:00
|
|
|
return d->isSelfSigned;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CertificateInfo::setSelfSigned(bool selfSigned)
|
|
|
|
{
|
|
|
|
d->isSelfSigned = selfSigned;
|
2019-01-05 22:30:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QByteArray CertificateInfo::certificateData() const
|
|
|
|
{
|
2023-04-21 10:50:46 +00:00
|
|
|
return d->certificateData;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CertificateInfo::setCertificateData(const QByteArray &certificateData)
|
|
|
|
{
|
|
|
|
d->certificateData = certificateData;
|
2019-01-05 22:30:25 +00:00
|
|
|
}
|
|
|
|
|
2023-06-25 22:41:22 +00:00
|
|
|
CertificateInfo::Backend CertificateInfo::backend() const
|
|
|
|
{
|
|
|
|
return d->backend;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CertificateInfo::setBackend(Backend backend)
|
|
|
|
{
|
|
|
|
d->backend = backend;
|
|
|
|
}
|
|
|
|
|
2023-04-21 10:50:46 +00:00
|
|
|
bool CertificateInfo::checkPassword(const QString &password) const
|
2020-11-26 16:45:59 +00:00
|
|
|
{
|
2023-04-21 10:50:46 +00:00
|
|
|
if (d->checkPasswordFunction) {
|
|
|
|
return d->checkPasswordFunction(password);
|
|
|
|
}
|
2020-11-26 16:45:59 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2023-04-21 10:50:46 +00:00
|
|
|
void CertificateInfo::setCheckPasswordFunction(const std::function<bool(const QString &)> &passwordFunction)
|
2019-01-05 22:30:25 +00:00
|
|
|
{
|
2023-04-21 10:50:46 +00:00
|
|
|
d->checkPasswordFunction = passwordFunction;
|
2019-01-05 22:30:25 +00:00
|
|
|
}
|
|
|
|
|
2023-04-21 10:50:46 +00:00
|
|
|
class Okular::SignatureInfoPrivate : public QSharedData
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SignatureInfo::SignatureStatus signatureStatus = SignatureInfo::SignatureStatusUnknown;
|
|
|
|
SignatureInfo::CertificateStatus certificateStatus = SignatureInfo::CertificateStatusUnknown;
|
|
|
|
SignatureInfo::HashAlgorithm hashAlgorithm = SignatureInfo::HashAlgorithmUnknown;
|
|
|
|
QString signerName;
|
|
|
|
QString signerSubjectDN;
|
|
|
|
QString location;
|
|
|
|
QString reason;
|
|
|
|
QDateTime signingTime;
|
|
|
|
QByteArray signature;
|
|
|
|
QList<qint64> signedRangeBounds;
|
|
|
|
bool signsTotalDocument = false;
|
|
|
|
CertificateInfo certificateInfo;
|
|
|
|
};
|
|
|
|
|
|
|
|
SignatureInfo::SignatureInfo()
|
|
|
|
: d {new SignatureInfoPrivate()}
|
2019-01-05 22:30:25 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2023-04-21 10:50:46 +00:00
|
|
|
SignatureInfo::SignatureInfo(SignatureInfo &&other) noexcept = default;
|
|
|
|
SignatureInfo::SignatureInfo(const SignatureInfo &other) = default;
|
|
|
|
SignatureInfo &SignatureInfo::operator=(SignatureInfo &&other) noexcept = default;
|
|
|
|
Okular::SignatureInfo &Okular::SignatureInfo::operator=(const Okular::SignatureInfo &other) = default;
|
|
|
|
SignatureInfo::~SignatureInfo() = default;
|
|
|
|
|
2019-01-05 22:30:25 +00:00
|
|
|
SignatureInfo::SignatureStatus SignatureInfo::signatureStatus() const
|
|
|
|
{
|
2023-04-21 10:50:46 +00:00
|
|
|
return d->signatureStatus;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SignatureInfo::setSignatureStatus(SignatureInfo::SignatureStatus status)
|
|
|
|
{
|
|
|
|
d->signatureStatus = status;
|
2019-01-05 22:30:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
SignatureInfo::CertificateStatus SignatureInfo::certificateStatus() const
|
|
|
|
{
|
2023-04-21 10:50:46 +00:00
|
|
|
return d->certificateStatus;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SignatureInfo::setCertificateStatus(SignatureInfo::CertificateStatus status)
|
|
|
|
{
|
|
|
|
d->certificateStatus = status;
|
2019-01-05 22:30:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
SignatureInfo::HashAlgorithm SignatureInfo::hashAlgorithm() const
|
|
|
|
{
|
2023-04-21 10:50:46 +00:00
|
|
|
return d->hashAlgorithm;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Okular::SignatureInfo::setHashAlgorithm(Okular::SignatureInfo::HashAlgorithm algorithm)
|
|
|
|
{
|
|
|
|
d->hashAlgorithm = algorithm;
|
2019-01-05 22:30:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QString SignatureInfo::signerName() const
|
|
|
|
{
|
2023-04-21 10:50:46 +00:00
|
|
|
return d->signerName;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SignatureInfo::setSignerName(const QString &signerName)
|
|
|
|
{
|
|
|
|
d->signerName = signerName;
|
2019-01-05 22:30:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QString SignatureInfo::signerSubjectDN() const
|
|
|
|
{
|
2023-04-21 10:50:46 +00:00
|
|
|
return d->signerSubjectDN;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Okular::SignatureInfo::setSignerSubjectDN(const QString &signerSubjectDN)
|
|
|
|
{
|
|
|
|
d->signerSubjectDN = signerSubjectDN;
|
2019-01-05 22:30:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QString SignatureInfo::location() const
|
|
|
|
{
|
2023-04-21 10:50:46 +00:00
|
|
|
return d->location;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SignatureInfo::setLocation(const QString &location)
|
|
|
|
{
|
|
|
|
d->location = location;
|
2019-01-05 22:30:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QString SignatureInfo::reason() const
|
|
|
|
{
|
2023-04-21 10:50:46 +00:00
|
|
|
return d->reason;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Okular::SignatureInfo::setReason(const QString &reason)
|
|
|
|
{
|
|
|
|
d->reason = reason;
|
2019-01-05 22:30:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QDateTime SignatureInfo::signingTime() const
|
|
|
|
{
|
2023-04-21 10:50:46 +00:00
|
|
|
return d->signingTime;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Okular::SignatureInfo::setSigningTime(const QDateTime &time)
|
|
|
|
{
|
|
|
|
d->signingTime = time;
|
2019-01-05 22:30:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QByteArray SignatureInfo::signature() const
|
|
|
|
{
|
2023-04-21 10:50:46 +00:00
|
|
|
return d->signature;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SignatureInfo::setSignature(const QByteArray &signature)
|
|
|
|
{
|
|
|
|
d->signature = signature;
|
2019-01-05 22:30:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QList<qint64> SignatureInfo::signedRangeBounds() const
|
|
|
|
{
|
2023-04-21 10:50:46 +00:00
|
|
|
return d->signedRangeBounds;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SignatureInfo::setSignedRangeBounds(const QList<qint64> &range)
|
|
|
|
{
|
|
|
|
d->signedRangeBounds = range;
|
2019-01-05 22:30:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool SignatureInfo::signsTotalDocument() const
|
|
|
|
{
|
2023-04-21 10:50:46 +00:00
|
|
|
return d->signsTotalDocument;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SignatureInfo::setSignsTotalDocument(bool total)
|
|
|
|
{
|
|
|
|
d->signsTotalDocument = total;
|
|
|
|
}
|
|
|
|
|
|
|
|
CertificateInfo SignatureInfo::certificateInfo() const
|
|
|
|
{
|
|
|
|
return d->certificateInfo;
|
2019-01-05 22:30:25 +00:00
|
|
|
}
|
|
|
|
|
2023-04-21 10:50:46 +00:00
|
|
|
void SignatureInfo::setCertificateInfo(const Okular::CertificateInfo &info)
|
2019-01-05 22:30:25 +00:00
|
|
|
{
|
2023-04-21 10:50:46 +00:00
|
|
|
d->certificateInfo = info;
|
2019-01-05 22:30:25 +00:00
|
|
|
}
|
2019-12-11 09:44:55 +00:00
|
|
|
|
|
|
|
CertificateStore::CertificateStore()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
CertificateStore::~CertificateStore()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2023-04-21 10:50:46 +00:00
|
|
|
QList<CertificateInfo> CertificateStore::signingCertificates(bool *userCancelled) const
|
2019-12-11 09:44:55 +00:00
|
|
|
{
|
2020-11-26 20:51:46 +00:00
|
|
|
*userCancelled = false;
|
2023-04-21 10:50:46 +00:00
|
|
|
return QList<CertificateInfo>();
|
2019-12-11 09:44:55 +00:00
|
|
|
}
|
2021-12-07 09:52:09 +00:00
|
|
|
|
2023-04-21 10:50:46 +00:00
|
|
|
QList<CertificateInfo> CertificateStore::signingCertificatesForNow(bool *userCancelled, bool *nonDateValidCerts) const
|
2021-12-07 09:52:09 +00:00
|
|
|
{
|
|
|
|
const QDateTime now = QDateTime::currentDateTime();
|
2023-04-21 10:50:46 +00:00
|
|
|
QList<Okular::CertificateInfo> certs = signingCertificates(userCancelled);
|
2021-12-07 09:52:09 +00:00
|
|
|
auto it = certs.begin();
|
|
|
|
*nonDateValidCerts = false;
|
|
|
|
while (it != certs.end()) {
|
2023-04-21 10:50:46 +00:00
|
|
|
if (it->validityStart() > now || now > it->validityEnd()) {
|
2021-12-07 09:52:09 +00:00
|
|
|
it = certs.erase(it);
|
|
|
|
*nonDateValidCerts = true;
|
|
|
|
} else {
|
|
|
|
++it;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return certs;
|
|
|
|
}
|