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 <QStringList>
17#include <memory>
18
19class QDate;
20class QString;
21
22namespace Kleo
23{
24class KeyUsage;
25
26class KLEO_EXPORT KeyParameters
27{
28public:
29 enum Protocol {
30 NoProtocol,
31 OpenPGP,
32 CMS,
33 };
34
35 KeyParameters();
36 explicit KeyParameters(Protocol protocol);
37 ~KeyParameters();
38
39 KeyParameters(const KeyParameters &other);
40 KeyParameters &operator=(const KeyParameters &other);
41
42 KeyParameters(KeyParameters &&other);
43 KeyParameters &operator=(KeyParameters &&other);
44
45 Protocol protocol() const;
46
47 void setKeyType(GpgME::Subkey::PubkeyAlgo type);
48 GpgME::Subkey::PubkeyAlgo keyType() const;
49 void setCardKeyRef(const QString &cardKeyRef);
50 QString cardKeyRef() const;
51 void setKeyLength(unsigned int length);
52 unsigned int keyLength() const;
53 void setKeyCurve(const QString &curve);
54 QString keyCurve() const;
55 void setKeyUsage(const KeyUsage &usage);
56 KeyUsage keyUsage() const;
57
58 void setSubkeyType(GpgME::Subkey::PubkeyAlgo type);
59 GpgME::Subkey::PubkeyAlgo subkeyType() const;
60 void setSubkeyLength(unsigned int length);
61 unsigned int subkeyLength() const;
62 void setSubkeyCurve(const QString &curve);
63 QString subkeyCurve() const;
64 void setSubkeyUsage(const KeyUsage &usage);
65 KeyUsage subkeyUsage() const;
66
67 void setExpirationDate(const QDate &date);
68 QDate expirationDate() const;
69
70 void setName(const QString &name);
71 QString name() const;
72 void setComment(const QString &comment);
73 QString comment() const;
74 void setDN(const QString &dn);
75 QString dn() const;
76 void setEmail(const QString &email);
77 void addEmail(const QString &email);
78 const std::vector<QString> &emails() const;
79 void addDomainName(const QString &domain);
80 const std::vector<QString> &domainNames() const;
81 void addURI(const QString &uri);
82 const std::vector<QString> &uris() const;
83
84 QString serial() const;
85 void setSerial(const QString &serial);
86 void setUseRandomSerial();
87
88 QString issuerDN() const;
89 void setIssuerDN(const QString &issuerDN);
90
91 QString signingKey() const;
92 void setSigningKey(const QString &signingKey);
93
94 QStringList controlStatements() const;
95 void setControlStatements(const QStringList &controlStatements);
96
97 QString toString() const;
98
99private:
100 class Private;
101 std::unique_ptr<Private> d;
102};
103
104}
char * toString(const EngineQuery &query)
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Apr 4 2025 12:04:00 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.