mirror of
https://github.com/AGWA/git-crypt.git
synced 2025-12-26 12:50:39 -08:00
Add --trusted option to gpg-add-user
If this option is specified, then the GPG users are added even if their keys are not trusted by GPG. In addition, if a full fingerprint, prefixed by 0x, is specified, it is assumed to be trusted, regardless of its trust level in the GPG trustdb.
This commit is contained in:
6
gpg.cpp
6
gpg.cpp
@@ -150,12 +150,16 @@ std::vector<std::string> gpg_list_secret_keys ()
|
||||
return secret_keys;
|
||||
}
|
||||
|
||||
void gpg_encrypt_to_file (const std::string& filename, const std::string& recipient_fingerprint, const char* p, size_t len)
|
||||
void gpg_encrypt_to_file (const std::string& filename, const std::string& recipient_fingerprint, bool key_is_trusted, const char* p, size_t len)
|
||||
{
|
||||
// gpg --batch -o FILENAME -r RECIPIENT -e
|
||||
std::vector<std::string> command;
|
||||
command.push_back("gpg");
|
||||
command.push_back("--batch");
|
||||
if (key_is_trusted) {
|
||||
command.push_back("--trust-model");
|
||||
command.push_back("always");
|
||||
}
|
||||
command.push_back("-o");
|
||||
command.push_back(filename);
|
||||
command.push_back("-r");
|
||||
|
||||
Reference in New Issue
Block a user