aboutsummaryrefslogtreecommitdiffstats
path: root/src/cli/cli.h
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2015-12-23 01:23:26 -0500
committerJack Lloyd <[email protected]>2015-12-23 01:23:26 -0500
commit9c504c706eec7fd96f728d1da28f6661a3d640b8 (patch)
tree09ee6d8333cea4226834fc131d8a98594f1254eb /src/cli/cli.h
parentbafdddbbf4c89c0ac4c4d1a209fb00502c52a430 (diff)
Add DSA keygen and --der-out flag to keygen and pkcs8 tools
If no files are given on the command line to `hash`, default to stdin
Diffstat (limited to 'src/cli/cli.h')
-rw-r--r--src/cli/cli.h26
1 files changed, 2 insertions, 24 deletions
diff --git a/src/cli/cli.h b/src/cli/cli.h
index fdc83e97b..017966eca 100644
--- a/src/cli/cli.h
+++ b/src/cli/cli.h
@@ -439,31 +439,9 @@ class Command
}
template<typename Alloc>
- void write_output_file(const std::string& who,
- const std::vector<uint8_t, Alloc>& vec) const
+ void write_output(const std::vector<uint8_t, Alloc>& vec)
{
- write_output_file(who, vec.begin(), vec.size());
- }
-
- void write_output_file(const std::string& output_file,
- const uint8_t buf[], size_t buf_len) const
- {
- std::ofstream out(output_file, std::ios::binary);
- if(!out.good())
- throw CLI_IO_Error("writing", output_file);
-
- out.write(reinterpret_cast<const char*>(buf), buf_len);
- out.close();
- }
-
- void write_output_file(const std::string& output_file, const std::string& outstr) const
- {
- std::ofstream out(output_file);
- if(!out.good())
- throw CLI_IO_Error("writing", output_file);
-
- out.write(outstr.data(), outstr.size());
- out.close();
+ output().write(reinterpret_cast<const char*>(vec.data()), vec.size());
}
private: