diff options
Diffstat (limited to 'src/gpg/function/GpgKeyManager.cpp')
-rw-r--r-- | src/gpg/function/GpgKeyManager.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/gpg/function/GpgKeyManager.cpp b/src/gpg/function/GpgKeyManager.cpp index 361c00bd..9e24b3d6 100644 --- a/src/gpg/function/GpgKeyManager.cpp +++ b/src/gpg/function/GpgKeyManager.cpp @@ -1,7 +1,7 @@ /** - * This file is part of GPGFrontend. + * This file is part of GpgFrontend. * - * GPGFrontend is free software: you can redistribute it and/or modify + * GpgFrontend is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. @@ -23,14 +23,15 @@ */ #include "gpg/function/GpgKeyManager.h" + #include <boost/date_time/posix_time/conversion.hpp> #include <string> + #include "gpg/function/BasicOperator.h" #include "gpg/function/GpgKeyGetter.h" bool GpgFrontend::GpgKeyManager::signKey( - const GpgFrontend::GpgKey& target, - GpgFrontend::KeyArgsList& keys, + const GpgFrontend::GpgKey& target, GpgFrontend::KeyArgsList& keys, const std::string& uid, const std::unique_ptr<boost::gregorian::date>& expires) { using namespace boost::posix_time; @@ -62,27 +63,23 @@ bool GpgFrontend::GpgKeyManager::revSign( auto err = check_gpg_error(gpgme_op_revsig(ctx, gpgme_key_t(key), gpgme_key_t(signing_key), sign_id.second.c_str(), 0)); - if (check_gpg_error_2_err_code(err) != GPG_ERR_NO_ERROR) - return false; + if (check_gpg_error_2_err_code(err) != GPG_ERR_NO_ERROR) return false; } return true; } bool GpgFrontend::GpgKeyManager::setExpire( - const GpgFrontend::GpgKey& key, - std::unique_ptr<GpgSubKey>& subkey, + const GpgFrontend::GpgKey& key, std::unique_ptr<GpgSubKey>& subkey, std::unique_ptr<boost::gregorian::date>& expires) { using namespace boost::posix_time; unsigned long expires_time = 0; - if (expires != nullptr) - expires_time = to_time_t(ptime(*expires)); + if (expires != nullptr) expires_time = to_time_t(ptime(*expires)); const char* sub_fprs = nullptr; - if (subkey != nullptr) - sub_fprs = subkey->fpr().c_str(); + if (subkey != nullptr) sub_fprs = subkey->fpr().c_str(); auto err = check_gpg_error( gpgme_op_setexpire(ctx, gpgme_key_t(key), expires_time, sub_fprs, 0)); |