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
19struct UserInfo {
24
30 auto fullyValid() const -> bool {
31 return (validity == 'f') || (validity == 'u');
32 }
33
38 auto marginallyValid() const -> bool { return validity == 'm'; }
43 auto isValid() const -> bool { return fullyValid() || marginallyValid(); }
44
48 QString name;
52 QString key_id;
57 char validity{'-'};
61 bool have_secret{false};
65 bool enabled{false};
69 QDateTime expiry;
73 QDateTime created;
74};
75
76#endif // SRC_USERINFO_H_
bool have_secret
Whether secret key is available (can decrypt with this key).
Definition userinfo.h:61
bool enabled
Whether this user/key is enabled for normal use.
Definition userinfo.h:65
auto marginallyValid() const -> bool
Check marginal validity per GnuPG validity codes.
Definition userinfo.h:38
QString key_id
Hexadecimal representation of the GnuPG key identifier.
Definition userinfo.h:52
auto fullyValid() const -> bool
Check full validity per GnuPG validity codes.
Definition userinfo.h:30
auto isValid() const -> bool
Check whether the key has any usable validity level.
Definition userinfo.h:43
QDateTime created
Date/time when key was created.
Definition userinfo.h:73
QString name
GPG user ID / full name.
Definition userinfo.h:48
UserInfo()
Construct a UserInfo with default (invalid/disabled) state.
Definition userinfo.h:23
char validity
GnuPG representation of validity. http://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg....
Definition userinfo.h:57
QDateTime expiry
Date/time when key expires.
Definition userinfo.h:69