-
Notifications
You must be signed in to change notification settings - Fork 1
/
GPGKeyDetails.hpp
58 lines (49 loc) · 1.67 KB
/
GPGKeyDetails.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
* This file is part of kate-gpg-plugin (https://github.com/dennis2society).
* Copyright (c) 2023 Dennis Luebke.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
/**
* @brief This class contains the details for a GPG key
**/
#include <QString>
#include <QVector>
#include <gpgme++/key.h>
class GPGKeyDetails {
public:
GPGKeyDetails();
~GPGKeyDetails();
QString fingerPrint() const;
QString keyID() const;
QString keyType() const;
QString keyLength() const;
QString creationDate() const;
QString expiryDate() const;
const QVector<QString>& uids() const; // this returns a list of all names per key
const QVector<QString>& mailAdresses() const; // this returns a list of all email addresses associated with this key
const QVector<QString>& subkeyIDs() const; // this returns a list of all "IDs" per key
size_t getNumUIds() const;
void loadFromGPGMeKey(GpgME::Key key_);
private:
QString m_fingerPrint;
QString m_keyID;
QString m_keyType;
QString m_keyLength;
QString m_creationDate;
QString m_expiryDate;
QVector<QString> m_uids;
QVector<QString> m_mailAddresses;
QVector<QString> m_subkeyIDs;
};