|
QtPass 2.0.0
Developer documentation
|
Parsing of gpg --with-colons key listings into UserInfo records. More...
Go to the source code of this file.
Enumerations | |
| enum class | GpgRecordType { Unknown , Pub , Sec , Uid , Fpr , Sub , Ssb , Grp } |
| The record types of a gpg --with-colons listing that the parser tells apart; the first field of each line names one. More... | |
Functions | |
| GpgRecordType | classifyRecord (const QString &record_type) |
| Classify a record of a gpg colon listing by its first field. | |
| QList< UserInfo > | parseGpgColonOutput (const QString &output, bool secret) |
| Parse a gpg colon listing into one UserInfo per key. | |
| QString | primaryFingerprintOf (const QString &output, const QString &key) |
The primary key fingerprint of the key that key names. | |
Parsing of gpg --with-colons key listings into UserInfo records.
Definition in file gpgkeystate.h.
|
strong |
The record types of a gpg --with-colons listing that the parser tells apart; the first field of each line names one.
Definition at line 21 of file gpgkeystate.h.
| GpgRecordType classifyRecord | ( | const QString & | record_type | ) |
Classify a record of a gpg colon listing by its first field.
| record_type | The first field of the record (pub, sec, uid, and so on). |
Definition at line 34 of file gpgkeystate.cpp.
| QList< UserInfo > parseGpgColonOutput | ( | const QString & | output, |
| bool | secret ) |
Parse a gpg colon listing into one UserInfo per key.
A pub or sec record starts a key; the first uid after it supplies the name when the key record carried none, and an fpr record whose value ends in the key ID replaces the key ID with the full fingerprint. Lines with fewer than ten fields are skipped.
| output | Raw output of gpg --with-colons --with-fingerprint. |
| secret | True when output lists secret keys (--list-secret-keys); the keys are then marked as having a secret part. |
Definition at line 112 of file gpgkeystate.cpp.
| QString primaryFingerprintOf | ( | const QString & | output, |
| const QString & | key ) |
The primary key fingerprint of the key that key names.
gpg accepts a signature by a subkey for its primary key, and verification here takes either fingerprint from VALIDSIG: a key written as a subkey's fingerprint, or as a key ID, signs as its primary key. Only the block that holds key is taken, whatever else gpg printed; when several do (a short ID, which collides easily), none is.
| output | Raw output from GPG –with-colons –with-fingerprint –with-subkey-fingerprint –list-keys. |
| key | A fingerprint (40 or 64 hex) or a key ID (8 or 16 hex), optionally with 0x; any case. A key ID is matched against the record's own key ID, so it works for v4 keys (the fingerprint's tail) and v5/v6 keys (its head) alike. |
output holds key. Definition at line 160 of file gpgkeystate.cpp.