Libkleo

keyparameters.h
1/* -*- mode: c++; c-basic-offset:4 -*-
2 utils/keyparameters.h
3
4 This file is part of Kleopatra, the KDE keymanager
5 SPDX-FileCopyrightText: 2020, 2022 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#pragma once
12
13#include "kleo_export.h"
14#include <gpgme++/key.h>
15
16#include <memory>
17
18class QDate;
19class QString;
20
21namespace Kleo
22{
23class KeyUsage;
24
25class KLEO_EXPORT KeyParameters
26{
27public:
28 enum Protocol {
29 NoProtocol,
30 OpenPGP,
31 CMS,
32 };
33
34 KeyParameters();
35 explicit KeyParameters(Protocol protocol);
36 ~KeyParameters();
37
38 KeyParameters(const KeyParameters &other);
39 KeyParameters &operator=(const KeyParameters &other);
40
41 KeyParameters(KeyParameters &&other);
42 KeyParameters &operator=(KeyParameters &&other);
43
44 Protocol protocol() const;
45
46 void setKeyType(GpgME::Subkey::PubkeyAlgo type);
47 GpgME::Subkey::PubkeyAlgo keyType() const;
48 void setCardKeyRef(const QString &cardKeyRef);
49 QString cardKeyRef() const;
50 void setKeyLength(unsigned int length);
51 unsigned int keyLength() const;
52 void setKeyCurve(const QString &curve);
53 QString keyCurve() const;
54 void setKeyUsage(const KeyUsage &usage);
55 KeyUsage keyUsage() const;
56
57 void setSubkeyType(GpgME::Subkey::PubkeyAlgo type);
58 GpgME::Subkey::PubkeyAlgo subkeyType() const;
59 void setSubkeyLength(unsigned int length);
60 unsigned int subkeyLength() const;
61 void setSubkeyCurve(const QString &curve);
62 QString subkeyCurve() const;
63 void setSubkeyUsage(const KeyUsage &usage);
64 KeyUsage subkeyUsage() const;
65
66 void setExpirationDate(const QDate &date);
67 QDate expirationDate() const;
68
69 void setName(const QString &name);
70 QString name() const;
71 void setComment(const QString &comment);
72 QString comment() const;
73 void setDN(const QString &dn);
74 QString dn() const;
75 void setEmail(const QString &email);
76 void addEmail(const QString &email);
77 std::vector<QString> emails() const;
78 void addDomainName(const QString &domain);
79 std::vector<QString> domainNames() const;
80 void addURI(const QString &uri);
81 std::vector<QString> uris() const;
82
83 QString toString() const;
84
85private:
86 class Private;
87 std::unique_ptr<Private> d;
88};
89
90}
char * toString(const EngineQuery &query)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jul 26 2024 11:50:31 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.