File indexing completed on 2025-01-05 04:55:51

0001 /*
0002     utils/compat.h
0003 
0004     This file is part of libkleopatra, the KDE keymanagement library
0005     SPDX-FileCopyrightText: 2021 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 #pragma once
0012 
0013 #include "kleo_export.h"
0014 
0015 #include <sstream>
0016 
0017 namespace GpgME
0018 {
0019 class Key;
0020 }
0021 namespace QGpgME
0022 {
0023 class CryptoConfig;
0024 class CryptoConfigEntry;
0025 }
0026 
0027 namespace Kleo
0028 {
0029 
0030 KLEO_EXPORT QGpgME::CryptoConfigEntry *getCryptoConfigEntry(const QGpgME::CryptoConfig *config, const char *componentName, const char *entryName);
0031 
0032 /**
0033  * Returns true, if the key has a certification subkey.
0034  * Compatibility function for GpgME::Key::hasCertify() added in GpgME 1.23
0035  */
0036 KLEO_EXPORT bool keyHasCertify(const GpgME::Key &key);
0037 /**
0038  * Returns true, if the key has a signing subkey.
0039  * Compatibility function for GpgME::Key::hasSign() added in GpgME 1.23
0040  */
0041 KLEO_EXPORT bool keyHasSign(const GpgME::Key &key);
0042 /**
0043  * Returns true, if the key has an encryption subkey.
0044  * Compatibility function for GpgME::Key::hasEncrypt() added in GpgME 1.23
0045  */
0046 KLEO_EXPORT bool keyHasEncrypt(const GpgME::Key &key);
0047 /**
0048  * Returns true, if the key has an authentication subkey.
0049  * Compatibility function for GpgME::Key::hasAuthenticate() added in GpgME 1.23
0050  */
0051 KLEO_EXPORT bool keyHasAuthenticate(const GpgME::Key &key);
0052 }