QtPass  1.2.0
Multi-platform GUI for pass, the standard unix password manager.
datahelpers.h
Go to the documentation of this file.
1 #ifndef DATAHELPERS_H
2 #define DATAHELPERS_H
3 
4 #include <QDateTime>
5 #include <QString>
6 
15  enum characterSet {
16  ALLCHARS = 0,
20  CHARSETS_COUNT // have to be last, for easier initialization of arrays
21  } selected;
25  int length;
30  passwordConfiguration() : selected(ALLCHARS), length(16) {
31  Characters[ALLCHARS] =
32  "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890~!@#$%^&"
33  "*()_-+={}[]|:;<>,.?"; /*AllChars*/
34  Characters[ALPHABETICAL] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstu"
35  "vwxyz"; /*Only Alphabetical*/
36  Characters[ALPHANUMERIC] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstu"
37  "vwxyz1234567890"; /*Alphabetical and Numerical*/
38  Characters[CUSTOM] = Characters[ALLCHARS]; // this may be redefined by user
39  }
40 };
41 
46 struct UserInfo {
47  UserInfo() : validity('-'), have_secret(false), enabled(false) {}
48 
53  bool fullyValid() { return validity == 'f' || validity == 'u'; }
58  bool marginallyValid() { return validity == 'm'; }
62  bool isValid() { return fullyValid() || marginallyValid(); }
63 
67  QString name;
71  QString key_id;
76  char validity;
85  bool enabled;
89  QDateTime expiry;
93  QDateTime created;
94 };
95 
96 #endif // DATAHELPERS_H
QDateTime expiry
UserInfo::expiry date/time key expires.
Definition: datahelpers.h:89
QDateTime created
UserInfo::created date/time key was created.
Definition: datahelpers.h:93
int length
passwordConfiguration::length of password.
Definition: datahelpers.h:25
bool enabled
UserInfo::enabled.
Definition: datahelpers.h:85
QString key_id
UserInfo::key_id hexadecimal representation.
Definition: datahelpers.h:71
bool have_secret
UserInfo::have_secret secret key is available (can decrypt with this key)
Definition: datahelpers.h:81
char validity
UserInfo::validity GnuPG representation of validity http://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=blob_plain;f=doc/DETAILS.
Definition: datahelpers.h:76
QString Characters[CHARSETS_COUNT]
passwordConfiguration::Characters the different character sets.
Definition: datahelpers.h:29
enum passwordConfiguration::characterSet selected
bool marginallyValid()
UserInfo::marginallyValid when validity is m. http://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=blob_plain;f=doc/DETAILS.
Definition: datahelpers.h:58
bool isValid()
UserInfo::isValid when fullyValid or marginallyValid.
Definition: datahelpers.h:62
QString name
UserInfo::name full name.
Definition: datahelpers.h:67
Stores key info lines including validity, creation date and more.
Definition: datahelpers.h:46
bool fullyValid()
UserInfo::fullyValid when validity is f or u. http://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=blob_plain;f=doc/DETAILS.
Definition: datahelpers.h:53
holds the Password configuration settings
Definition: datahelpers.h:11
characterSet
passwordConfiguration::selected character set.
Definition: datahelpers.h:15