aboutsummaryrefslogtreecommitdiffstats
path: root/src/gpg/function/GpgKeyOpera.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/gpg/function/GpgKeyOpera.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/gpg/function/GpgKeyOpera.cpp b/src/gpg/function/GpgKeyOpera.cpp
index c60f9157..d0172a31 100644
--- a/src/gpg/function/GpgKeyOpera.cpp
+++ b/src/gpg/function/GpgKeyOpera.cpp
@@ -214,4 +214,23 @@ GpgFrontend::GpgError GpgFrontend::GpgKeyOpera::GenerateSubkey(
auto err =
gpgme_op_createsubkey(ctx, gpgme_key_t(key), algo, 0, expires, flags);
return check_gpg_error(err);
-} \ No newline at end of file
+}
+
+GpgFrontend::GpgError GpgFrontend::GpgKeyOpera::ModifyPassword(
+ const GpgFrontend::GpgKey& key) {
+ if (ctx.GetInfo().GnupgVersion < "2.0.15") {
+ LOG(ERROR) << _("operator not support");
+ return GPG_ERR_NOT_SUPPORTED;
+ }
+ auto err = gpgme_op_passwd(ctx, gpgme_key_t(key), 0);
+ return check_gpg_error(err);
+}
+GpgFrontend::GpgError GpgFrontend::GpgKeyOpera::ModifyTOFUPolicy(
+ const GpgFrontend::GpgKey& key, gpgme_tofu_policy_t tofu_policy) {
+ if (ctx.GetInfo().GnupgVersion < "2.1.10") {
+ LOG(ERROR) << _("operator not support");
+ return GPG_ERR_NOT_SUPPORTED;
+ }
+ auto err = gpgme_op_tofu_policy(ctx, gpgme_key_t(key), tofu_policy);
+ return check_gpg_error(err);
+}