diff options
author | Sven Gothel <[email protected]> | 2022-06-03 06:40:50 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2022-06-03 06:40:50 +0200 |
commit | d09593b0a8ec180b8a6b1d925fcd53d3848f14fe (patch) | |
tree | 7c30c538da1a0fa0629a83d0b1beaae506439799 /examples/cipherpack/commandline.cpp | |
parent | d826f8c14fbb2a4f072ffd681728df4e0ad04c82 (diff) |
Simplify *encrypt* and *decrypt* API, use destination_fname as an optional file sink, resuding Java API mapping; Working 1st Java unit test
Diffstat (limited to 'examples/cipherpack/commandline.cpp')
-rw-r--r-- | examples/cipherpack/commandline.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/cipherpack/commandline.cpp b/examples/cipherpack/commandline.cpp index 4ea4bc1..aa8a739 100644 --- a/examples/cipherpack/commandline.cpp +++ b/examples/cipherpack/commandline.cpp @@ -37,7 +37,6 @@ int main(int argc, char *argv[]) print_usage(argv[0]); return -1; } - const bool overwrite = true; const std::string command = argv[++argi]; if( command == "pack") { @@ -93,8 +92,8 @@ int main(int argc, char *argv[]) enc_pub_keys, sign_sec_key_fname, sign_sec_key_passphrase, *source, target_path, intention, payload_version, payload_version_parent, - fname_output, overwrite, - std::make_shared<cipherpack::CipherpackListener>()); + std::make_shared<cipherpack::CipherpackListener>(), + fname_output); jau::PLAIN_PRINT(true, "Pack: Encrypted %s to %s\n", source_name.c_str(), fname_output.c_str()); jau::PLAIN_PRINT(true, "Pack: %s\n", ph.toString(true, true).c_str()); return ph.isValid() ? 0 : -1; @@ -136,8 +135,9 @@ int main(int argc, char *argv[]) source = std::make_unique<jau::io::ByteInStream_File>(source_name, true /* use_binary */); } cipherpack::PackHeader ph = cipherpack::checkSignThenDecrypt(sign_pub_keys, dec_sec_key_fname, dec_sec_key_passphrase, - *source, fname_output, overwrite, - std::make_shared<cipherpack::CipherpackListener>()); + *source, + std::make_shared<cipherpack::CipherpackListener>(), + fname_output); // dec_sec_key_passphrase.resize(0); jau::PLAIN_PRINT(true, "Unpack: Decypted %s to %s\n", source_name.c_str(), fname_output.c_str()); jau::PLAIN_PRINT(true, "Unpack: %s\n", ph.toString(true, true).c_str()); |