From f8e8cc160048cc7032254f1db7548c68571c3409 Mon Sep 17 00:00:00 2001 From: Michael Raitza Date: Tue, 28 Jul 2020 21:08:39 +0200 Subject: Implement cryptographic access to files using GPGME --- src/context.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/context.h') diff --git a/src/context.h b/src/context.h index ca7af060..bf97feb5 100644 --- a/src/context.h +++ b/src/context.h @@ -45,6 +45,10 @@ #include "utils.h" #include "times.h" +#if HAVE_GPGME +#include "gpgme.h" +#endif + namespace ledger { class journal_t; @@ -119,7 +123,11 @@ inline parse_context_t open_for_reading(const path& pathname, _f("Cannot read journal file %1%") % filename); path parent(filename.parent_path()); +#if HAVE_GPGME + shared_ptr stream(decrypted_stream_t::open_stream(filename)); +#else shared_ptr stream(new ifstream(filename)); +#endif parse_context_t context(stream, parent); context.pathname = filename; return context; -- cgit v1.2.3