|
QtPass 1.6.0
Multi-platform GUI for pass, the standard unix password manager.
|
Abstract base class for password store operations. More...
#include <pass.h>
Signals | |
| void | error (QProcess::ProcessError) |
| Emitted when a process error occurs. | |
| void | startingExecuteWrapper () |
| Emitted before executing a command. | |
| void | statusMsg (const QString &, int) |
| Emit status message. | |
| void | critical (const QString &, const QString &) |
| Emit critical error. | |
| void | processErrorExit (int exitCode, const QString &err) |
| Emitted on process error exit. | |
| void | finishedAny (const QString &, const QString &) |
| Emitted when any operation finishes. | |
| void | finishedGitInit (const QString &, const QString &) |
| Emitted when Git init finishes. | |
| void | finishedGitPull (const QString &, const QString &) |
| Emitted when Git pull finishes. | |
| void | finishedGitPush (const QString &, const QString &) |
| Emitted when Git push finishes. | |
| void | finishedShow (const QString &) |
| Emitted when show finishes. | |
| void | finishedOtpGenerate (const QString &) |
| Emitted when OTP generation finishes. | |
| void | finishedInsert (const QString &, const QString &) |
| Emitted when insert finishes. | |
| void | finishedRemove (const QString &, const QString &) |
| Emitted when remove finishes. | |
| void | finishedInit (const QString &, const QString &) |
| Emitted when init finishes. | |
| void | finishedMove (const QString &, const QString &) |
| Emitted when move finishes. | |
| void | finishedCopy (const QString &, const QString &) |
| Emitted when copy finishes. | |
| void | finishedGenerate (const QString &, const QString &) |
| Emitted when generate finishes. | |
| void | finishedGenerateGPGKeys (const QString &, const QString &) |
| Emitted when GPG key generation finishes. | |
Public Member Functions | |
| Pass () | |
| Construct a Pass instance. | |
| void | init () |
| Initialize the Pass instance. | |
| ~Pass () override=default | |
| virtual void | GitInit ()=0 |
| Initialize Git repository in password store. | |
| virtual void | GitPull ()=0 |
| Pull changes from remote Git repository. | |
| virtual void | GitPull_b ()=0 |
| Pull with rebase from remote. | |
| virtual void | GitPush ()=0 |
| Push changes to remote Git repository. | |
| virtual void | Show (QString file)=0 |
| Show decrypted password file. | |
| virtual void | OtpGenerate (QString file)=0 |
| Generate OTP for password file. | |
| virtual void | Insert (QString file, QString value, bool force)=0 |
| Insert or update password. | |
| virtual void | Remove (QString file, bool isDir)=0 |
| Remove password file or directory. | |
| virtual void | Move (const QString srcDir, const QString dest, const bool force=false)=0 |
| Move password file or directory. | |
| virtual void | Copy (const QString srcDir, const QString dest, const bool force=false)=0 |
| Copy password file or directory. | |
| virtual void | Init (QString path, const QList< UserInfo > &users)=0 |
| Initialize new password store. | |
| virtual auto | generatePassword (unsigned int length, const QString &charset) -> QString |
| Generate random password. | |
| void | GenerateGPGKeys (QString batch) |
| Generate GPG keys using batch script. | |
| auto | listKeys (QStringList keystrings, bool secret=false) -> QList< UserInfo > |
| List GPG keys matching patterns. | |
| auto | listKeys (const QString &keystring="", bool secret=false) -> QList< UserInfo > |
| List GPG keys. | |
| void | updateEnv () |
| Update environment for subprocesses. | |
Static Public Member Functions | |
| static bool | gpgSupportsEd25519 () |
| Check if GPG supports Ed25519 encryption. | |
| static QString | getDefaultKeyTemplate () |
| Get default key template for new GPG keys. | |
| static auto | resolveGpgconfCommand (const QString &gpgPath) -> ResolvedGpgconfCommand |
| Resolve the gpgconf command to kill agents. | |
| static auto | getGpgIdPath (const QString &for_file) -> QString |
| Get .gpg-id file path for a password file. | |
| static auto | getRecipientList (const QString &for_file) -> QStringList |
| Get list of recipients for a password file. | |
| static auto | getRecipientString (const QString &for_file, const QString &separator=" ", int *count=nullptr) -> QStringList |
| Get recipients as string. | |
Protected Types | |
| using | PROCESS = Enums::PROCESS |
Protected Slots | |
| virtual void | finished (int id, int exitCode, const QString &out, const QString &err) |
| Handle process completion. | |
Protected Member Functions | |
| void | executeWrapper (PROCESS id, const QString &app, const QStringList &args, bool readStdout=true, bool readStderr=true) |
| Execute external wrapper command. | |
| auto | generateRandomPassword (const QString &charset, unsigned int length) -> QString |
| Generate random password from charset. | |
| auto | boundedRandom (quint32 bound) -> quint32 |
| Generate random number in range. | |
| virtual void | executeWrapper (PROCESS id, const QString &app, const QStringList &args, QString input, bool readStdout=true, bool readStderr=true) |
| Execute wrapper with input. | |
Protected Attributes | |
| Executor | exec |
Abstract base class for password store operations.
Pass provides an abstraction layer for password management, supporting both the native 'pass' utility and gopass/imitation backends. It handles:
Subclasses must implement Git and password operations.
|
protected |
| Pass::Pass | ( | ) |
Construct a Pass instance.
Pass::Pass wrapper for using either pass or the pass imitation.
Definition at line 34 of file pass.cpp.
|
overridedefault |
|
protected |
Generate random number in range.
Generates a random number bounded by the given value.
| bound | Upper bound (exclusive). |
| bound | Upper bound (exclusive) |
Definition at line 591 of file pass.cpp.
|
pure virtual |
Copy password file or directory.
| srcDir | Source path. |
| dest | Destination path. |
| force | Overwrite existing. |
Implemented in ImitatePass, and RealPass.
|
signal |
Emit critical error.
| title | Error title. |
| message | Error message. |
|
signal |
Emitted when a process error occurs.
|
protected |
Execute external wrapper command.
Executes a wrapper command.
| id | Process identifier. |
| app | Executable path. |
| args | Command arguments. |
| readStdout | Capture stdout. |
| readStderr | Capture stderr. |
| id | Process ID |
| app | Application to execute |
| args | Arguments |
| readStdout | Whether to read stdout |
| readStderr | Whether to read stderr |
Definition at line 57 of file pass.cpp.
|
protectedvirtual |
Execute wrapper with input.
| id | Process identifier. |
| app | Executable path. |
| args | Command arguments. |
| input | Input to pass to stdin. |
| readStdout | Capture stdout. |
| readStderr | Capture stderr. |
Reimplemented in ImitatePass.
Definition at line 63 of file pass.cpp.
|
protectedvirtualslot |
Handle process completion.
Pass::processFinished reemits specific signal based on what process has finished.
| id | Process identifier. |
| exitCode | Process exit code. |
| out | Standard output. |
| err | Standard error. |
| id | id of Pass process that was scheduled and finished |
| exitCode | return code of a process |
| out | output generated by process(if capturing was requested, empty otherwise) |
| err | error output generated by process(if capturing was requested, or error occurred) |
Reimplemented in ImitatePass.
Definition at line 429 of file pass.cpp.
|
signal |
Emitted when any operation finishes.
|
signal |
Emitted when copy finishes.
|
signal |
Emitted when generate finishes.
|
signal |
Emitted when GPG key generation finishes.
|
signal |
Emitted when Git init finishes.
|
signal |
Emitted when Git pull finishes.
|
signal |
Emitted when Git push finishes.
|
signal |
Emitted when init finishes.
|
signal |
Emitted when insert finishes.
|
signal |
Emitted when move finishes.
|
signal |
Emitted when OTP generation finishes.
|
signal |
Emitted when remove finishes.
|
signal |
Emitted when show finishes.
| void Pass::GenerateGPGKeys | ( | QString | batch | ) |
Generate GPG keys using batch script.
Pass::GenerateGPGKeys internal gpg keypair generator . .
| batch | GPG batch script content. |
| batch | GnuPG style configuration string |
Definition at line 369 of file pass.cpp.
|
virtual |
Generate random password.
Pass::Generate use either pwgen or internal password generator.
| length | Password length. |
| charset | Character set to use. |
| length | of the desired password |
| charset | to use for generation |
Definition at line 100 of file pass.cpp.
|
protected |
Generate random password from charset.
Generates a random password from the given charset.
| charset | Character set. |
| length | Password length. |
| charset | Characters to use in the password |
| length | Desired password length |
Definition at line 617 of file pass.cpp.
|
static |
Get default key template for new GPG keys.
Pass::getDefaultKeyTemplate return default key generation template Uses ed25519 if supported, otherwise falls back to RSA.
Definition at line 178 of file pass.cpp.
|
static |
Get .gpg-id file path for a password file.
Pass::getGpgIdPath return gpgid file path for some file (folder).
| for_file | Path to password file. |
| for_file | which file (folder) would you like the gpgid file path for. |
Definition at line 520 of file pass.cpp.
|
static |
Get list of recipients for a password file.
Pass::getRecipientList return list of gpg-id's to encrypt for.
| for_file | Path to password file. |
| for_file | which file (folder) would you like recipients for |
Definition at line 550 of file pass.cpp.
|
static |
Get recipients as string.
Pass::getRecipientString formatted string for use with GPG.
| for_file | Path to password file. |
| separator | Separator between recipients. |
| count | Pointer to store recipient count. |
| for_file | which file (folder) would you like recipients for |
| separator | formating separator eg: " -r " |
| count |
Definition at line 573 of file pass.cpp.
|
pure virtual |
Initialize Git repository in password store.
Implemented in ImitatePass, and RealPass.
|
pure virtual |
Pull changes from remote Git repository.
Implemented in ImitatePass, and RealPass.
|
pure virtual |
Pull with rebase from remote.
Implemented in ImitatePass, and RealPass.
|
pure virtual |
Push changes to remote Git repository.
Implemented in ImitatePass, and RealPass.
|
static |
Check if GPG supports Ed25519 encryption.
Pass::gpgSupportsEd25519 check if GPG supports ed25519 (ECC) GPG 2.1+ supports ed25519 which is much faster for key generation.
Definition at line 157 of file pass.cpp.
|
pure virtual |
Initialize new password store.
| path | Root of password store. |
| users | List of recipient GPG keys. |
Implemented in ImitatePass, and RealPass.
| void Pass::init | ( | ) |
|
pure virtual |
Insert or update password.
| file | Path to password file. |
| value | Password content to store. |
| force | Overwrite existing file. |
Implemented in ImitatePass, and RealPass.
| auto Pass::listKeys | ( | const QString & | keystring = "", |
| bool | secret = false ) -> QList< UserInfo > |
List GPG keys.
Pass::listKeys list users.
| keystring | Search pattern. |
| secret | Include secret keys. |
| keystring | |
| secret | list private keys |
Definition at line 415 of file pass.cpp.
| auto Pass::listKeys | ( | QStringList | keystrings, |
| bool | secret = false ) -> QList< UserInfo > |
List GPG keys matching patterns.
Pass::listKeys list users.
| keystrings | List of search patterns. |
| secret | Include secret keys. |
| keystrings | |
| secret | list private keys |
Definition at line 392 of file pass.cpp.
|
pure virtual |
Move password file or directory.
| srcDir | Source path. |
| dest | Destination path. |
| force | Overwrite existing. |
Implemented in ImitatePass, and RealPass.
|
pure virtual |
Generate OTP for password file.
| file | Path to password file. |
Implemented in ImitatePass, and RealPass.
|
signal |
Emitted on process error exit.
|
pure virtual |
Remove password file or directory.
| file | Path to remove. |
| isDir | true if removing a directory. |
Implemented in ImitatePass, and RealPass.
|
static |
|
pure virtual |
Show decrypted password file.
| file | Path to password file relative to store root. |
Implemented in ImitatePass, and RealPass.
|
signal |
Emitted before executing a command.
|
signal |
Emit status message.
| Message | text. |
| Timeout | in ms. |
| void Pass::updateEnv | ( | ) |
Update environment for subprocesses.
Pass::updateEnv update the execution environment (used when switching profiles).
Definition at line 482 of file pass.cpp.
|
protected |