diff options
author | Saturneric <[email protected]> | 2021-12-31 18:55:29 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2021-12-31 18:55:29 +0000 |
commit | 5e0e6494c76154b1da5002bda05e23258678c403 (patch) | |
tree | 5bfe8fb8d7670f0349d9a562daf8bdf960214071 /src/gpg/function/GpgKeyOpera.cpp | |
parent | <refactor, test>(core, test): core improved and test gpg key generation (diff) | |
download | GpgFrontend-5e0e6494c76154b1da5002bda05e23258678c403.tar.gz GpgFrontend-5e0e6494c76154b1da5002bda05e23258678c403.zip |
<refactor, fix, test>(core, test): test key generation for standalone mode
1. add key generation test for standalone mode
2. add supported algos in standalone mode
3. changed support algo vectors from static value to static getter
4. modified name of some variables.
Diffstat (limited to '')
-rw-r--r-- | src/gpg/function/GpgKeyOpera.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gpg/function/GpgKeyOpera.cpp b/src/gpg/function/GpgKeyOpera.cpp index 4cbc1d0a..df89c6f5 100644 --- a/src/gpg/function/GpgKeyOpera.cpp +++ b/src/gpg/function/GpgKeyOpera.cpp @@ -187,7 +187,8 @@ GpgFrontend::GpgError GpgFrontend::GpgKeyOpera::GenerateKey( boost::format{ "<GnupgKeyParms format=\"internal\">\n" "Key-Type: %1%\n" - "Subkey-Type: %2%\n" + "Key-Usage: sign\n" + "Key-Length: %2%\n" "Name-Real: %3%\n" "Name-Comment: %4%\n" "Name-Email: %5%\n"} % @@ -195,8 +196,11 @@ GpgFrontend::GpgError GpgFrontend::GpgKeyOpera::GenerateKey( params->getComment() % params->getEmail(); ss << param_format; - if (!params->isNonExpired()) - ss << boost::format{"Expire-Date: %1%\n"} % expires; + if (!params->isNonExpired()) { + auto date = params->getExpired().date(); + ss << boost::format{"Expire-Date: %1%\n"} % to_iso_string(date); + } else + ss << boost::format{"Expire-Date: 0\n"}; if (!params->isNoPassPhrase()) ss << boost::format{"Passphrase: %1%\n"} % params->getPassPhrase(); |