QtPass 2.0.0
Developer documentation
Loading...
Searching...
No Matches
userinfo.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2015 Anne Jan Brouwer
2// SPDX-License-Identifier: GPL-3.0-or-later
8#ifndef SRC_USERINFO_H_
9#define SRC_USERINFO_H_
10
11#include <QDateTime>
12#include <QString>
13#include <QStringList>
14
20struct UserInfo {
24 UserInfo() = default;
25
31 auto fullyValid() const -> bool {
32 return (validity == 'f') || (validity == 'u');
33 }
34
39 auto marginallyValid() const -> bool { return validity == 'm'; }
44 auto isValid() const -> bool { return fullyValid() || marginallyValid(); }
45
49 QString name;
53 QString key_id;
58 QStringList uids;
63 QStringList subkeys;
68 char validity{'-'};
72 bool have_secret{false};
76 bool enabled{false};
80 QDateTime expiry;
84 QDateTime created;
85};
86
87#endif // SRC_USERINFO_H_
bool have_secret
Whether secret key is available (can decrypt with this key).
Definition userinfo.h:72
bool enabled
Whether this user/key is enabled for normal use.
Definition userinfo.h:76
auto marginallyValid() const -> bool
Check marginal validity per GnuPG validity codes.
Definition userinfo.h:39
QStringList uids
Every user ID on the key, revoked ones included, with gpg's colon escapes (such as \x3a) decoded: the...
Definition userinfo.h:58
UserInfo()=default
Construct a UserInfo with default (invalid/disabled) state.
QStringList subkeys
Key IDs and fingerprints of the key's subkeys, by which a recipient list may name the key as well.
Definition userinfo.h:63
QString key_id
Hexadecimal representation of the GnuPG key identifier.
Definition userinfo.h:53
auto fullyValid() const -> bool
Check full validity per GnuPG validity codes.
Definition userinfo.h:31
auto isValid() const -> bool
Check whether the key has any usable validity level.
Definition userinfo.h:44
QDateTime created
Date/time when key was created.
Definition userinfo.h:84
QString name
GPG user ID / full name.
Definition userinfo.h:49
char validity
GnuPG representation of validity. http://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg....
Definition userinfo.h:68
QDateTime expiry
Date/time when key expires.
Definition userinfo.h:80