//**********************************************************************************
//EncryptPad Copyright 2016 Evgeny Pokhilko 
//<http://www.evpo.net/encryptpad>
//
//This file is part of EncryptPad
//
//EncryptPad is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation, either version 2 of the License, or
//(at your option) any later version.
//
//EncryptPad is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with EncryptPad.  If not, see <http://www.gnu.org/licenses/>.
//**********************************************************************************
#pragma once
#include <string>
#include "packet_composer.h"
#include "encryptmsg/emsg_types.h"

namespace EncryptPad
{
    EpadResult DecryptPacketFile(const std::string &file_in, const EncryptParams &encrypt_params, 
            Botan::SecureVector<byte> &output_buffer, PacketMetadata &metadata);

    EpadResult DecryptPacketFile(const std::string &file_in, const std::string &file_out, 
            const EncryptParams &encrypt_params, PacketMetadata &metadata);

    EpadResult DecryptBuffer(const Botan::SecureVector<byte> &input_buffer, const EncryptParams &encrypt_params,
             Botan::SecureVector<byte> &output_buffer, PacketMetadata &metadata);

    EpadResult EncryptBuffer(const Botan::SecureVector<byte> &input_buffer, EncryptParams &encrypt_params,
             Botan::SecureVector<byte> &output_buffer, PacketMetadata &metadata);

    EpadResult EncryptPacketFile(const std::string &file_in, const std::string &file_out, 
            EncryptParams &encrypt_params, PacketMetadata &metadata);

    EpadResult EncryptPacketFile(const Botan::SecureVector<byte> &input_buffer, const std::string &file_out, 
            EncryptParams &encrypt_params, PacketMetadata &metadata);

    bool CheckIfPassphraseProtected(const std::string &file_name, bool &wad_file, std::string &key_file);
    bool CheckIfKeyFileMayRequirePassphrase(const std::string &key_file);

}
