File indexing completed on 2024-05-26 05:24:21

0001 /*
0002     kleo/expirycheckerconfig.cpp
0003 
0004     This file is part of libkleopatra, the KDE keymanagement library
0005     SPDX-FileCopyrightText: 2023 g10 Code GmbH
0006     SPDX-FileContributor: Ingo Klöcker <dev@ingo-kloecker.de>
0007 
0008     SPDX-License-Identifier: GPL-2.0-or-later
0009 */
0010 
0011 #include <config-libkleo.h>
0012 
0013 #include "expirycheckerconfig.h"
0014 
0015 #include "expirycheckersettings.h"
0016 
0017 using namespace Kleo;
0018 
0019 ExpiryCheckerSettings ExpiryCheckerConfig::settings() const
0020 {
0021     using days = Kleo::chrono::days;
0022     return ExpiryCheckerSettings{days{ownKeyThresholdInDays()},
0023                                  days{otherKeyThresholdInDays()},
0024                                  days{rootCertificateThresholdInDays()},
0025                                  days{intermediateCertificateThresholdInDays()}};
0026 }
0027 
0028 const KConfigSkeletonItem *ExpiryCheckerConfig::ownKeyThresholdInDaysItem() const
0029 {
0030     return findItem(QStringLiteral("ownKeyThresholdInDays"));
0031 }
0032 
0033 const KConfigSkeletonItem *ExpiryCheckerConfig::otherKeyThresholdInDaysItem() const
0034 {
0035     return findItem(QStringLiteral("otherKeyThresholdInDays"));
0036 }
0037 
0038 const KConfigSkeletonItem *ExpiryCheckerConfig::rootCertificateThresholdInDaysItem() const
0039 {
0040     return findItem(QStringLiteral("rootCertificateThresholdInDays"));
0041 }
0042 
0043 const KConfigSkeletonItem *ExpiryCheckerConfig::intermediateCertificateThresholdInDaysItem() const
0044 {
0045     return findItem(QStringLiteral("intermediateCertificateThresholdInDays"));
0046 }