Libkleo

compat.cpp
1/*
2 utils/compat.cpp
3
4 This file is part of libkleopatra, the KDE keymanagement library
5 SPDX-FileCopyrightText: 2021 g10 Code GmbH
6 SPDX-FileContributor: Ingo Klöcker <dev@ingo-kloecker.de>
7
8 SPDX-License-Identifier: GPL-2.0-or-later
9*/
10
11#include <config-libkleo.h>
12
13#include "compat.h"
14
15#include "algorithm.h"
16
17#include <QGpgME/CryptoConfig>
18
19#include <gpgme++/key.h>
20
21using namespace QGpgME;
22
23QGpgME::CryptoConfigEntry *Kleo::getCryptoConfigEntry(const CryptoConfig *config, const char *componentName, const char *entryName)
24{
25 if (!config) {
26 return nullptr;
27 }
28 return config->entry(QString::fromLatin1(componentName), QString::fromLatin1(entryName));
29}
30
31bool Kleo::keyHasCertify(const GpgME::Key &key)
32{
33 return key.hasCertify();
34}
35
36bool Kleo::keyHasSign(const GpgME::Key &key)
37{
38 return key.hasSign();
39}
40
41bool Kleo::keyHasEncrypt(const GpgME::Key &key)
42{
43 return key.hasEncrypt();
44}
45
46bool Kleo::keyHasAuthenticate(const GpgME::Key &key)
47{
48 return key.hasAuthenticate();
49}
QString fromLatin1(QByteArrayView str)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 6 2024 12:02:18 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.