QtPass 1.6.0
Multi-platform GUI for pass, the standard unix password manager.
Loading...
Searching...
No Matches
gpgkeystate.cpp File Reference
#include "gpgkeystate.h"
#include "gpgkeystate_p.h"
#include "util.h"
#include <QRegularExpression>
Include dependency graph for gpgkeystate.cpp:

Go to the source code of this file.

Functions

auto classifyRecord (const QString &record_type) -> GpgRecordType
 Classify a GPG colon output record type.
void handlePubSecRecord (const QStringList &props, bool secret, UserInfo &current_user)
 Handle a pub or sec record in GPG colon output.
void handleUidRecord (const QStringList &props, UserInfo &current_user)
 Handle a uid record in GPG colon output.
void handleFprRecord (const QStringList &props, UserInfo &current_user)
 Handle an fpr (fingerprint) record in GPG colon output.
auto parseGpgColonOutput (const QString &output, bool secret) -> QList< UserInfo >
 Parse GPG –with-colons output into a list of UserInfo.

Variables

constexpr int GPG_MIN_FIELDS = 10
constexpr int GPG_FIELD_VALIDITY = 1
constexpr int GPG_FIELD_KEY_ID = 4
constexpr int GPG_FIELD_CREATED = 5
constexpr int GPG_FIELD_EXPIRY = 6
constexpr int GPG_FIELD_USERID = 9

Function Documentation

◆ classifyRecord()

auto classifyRecord ( const QString & record_type) -> GpgRecordType

Classify a GPG colon output record type.

Parameters
record_typeThe first field of a GPG colon record (e.g., "pub", "sec", "uid")
Returns
The corresponding GpgRecordType enum value

Definition at line 23 of file gpgkeystate.cpp.

Here is the caller graph for this function:

◆ handleFprRecord()

void handleFprRecord ( const QStringList & props,
UserInfo & current_user )

Handle an fpr (fingerprint) record in GPG colon output.

Parameters
propsThe colon-split fields of the record
current_userUserInfo to update with fingerprint if it matches key

Definition at line 94 of file gpgkeystate.cpp.

Here is the caller graph for this function:

◆ handlePubSecRecord()

void handlePubSecRecord ( const QStringList & props,
bool secret,
UserInfo & current_user )

Handle a pub or sec record in GPG colon output.

Parameters
propsThe colon-split fields of the record
secretTrue if this is a secret key record (sec)
current_userUserInfo to populate with key data

Definition at line 54 of file gpgkeystate.cpp.

Here is the caller graph for this function:

◆ handleUidRecord()

void handleUidRecord ( const QStringList & props,
UserInfo & current_user )

Handle a uid record in GPG colon output.

Parameters
propsThe colon-split fields of the record
current_userUserInfo to populate with user name

Definition at line 85 of file gpgkeystate.cpp.

Here is the caller graph for this function:

◆ parseGpgColonOutput()

auto parseGpgColonOutput ( const QString & output,
bool secret ) -> QList< UserInfo >

Parse GPG –with-colons output into a list of UserInfo.

Parameters
outputRaw output from GPG –with-colons –with-fingerprint
secretTrue if parsing secret keys (–list-secret-keys)
Returns
QList of parsed UserInfo objects
Examples
/home/annejan/Projects/QtPass/src/pass.cpp.

Definition at line 110 of file gpgkeystate.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ GPG_FIELD_CREATED

int GPG_FIELD_CREATED = 5
constexpr

Definition at line 13 of file gpgkeystate.cpp.

◆ GPG_FIELD_EXPIRY

int GPG_FIELD_EXPIRY = 6
constexpr

Definition at line 14 of file gpgkeystate.cpp.

◆ GPG_FIELD_KEY_ID

int GPG_FIELD_KEY_ID = 4
constexpr

Definition at line 12 of file gpgkeystate.cpp.

◆ GPG_FIELD_USERID

int GPG_FIELD_USERID = 9
constexpr

Definition at line 15 of file gpgkeystate.cpp.

◆ GPG_FIELD_VALIDITY

int GPG_FIELD_VALIDITY = 1
constexpr

Definition at line 11 of file gpgkeystate.cpp.

◆ GPG_MIN_FIELDS

int GPG_MIN_FIELDS = 10
constexpr

Definition at line 10 of file gpgkeystate.cpp.