Cipherpack v1.2.0-dirty
A Cryprographic Stream Processor
Classes | Namespaces | Macros | Typedefs | Functions
cipherpack.hpp File Reference
#include <string>
#include <cstdint>
#include <functional>
#include <botan_all.h>
#include <cipherpack/version.hpp>
#include <jau/basic_types.hpp>
#include <jau/file_util.hpp>
#include <jau/byte_stream.hpp>
#include <jau/io_util.hpp>
#include <jau/environment.hpp>
#include <jau/java_uplink.hpp>
Include dependency graph for cipherpack.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  cipherpack::CipherpackListener
 Listener for events occurring while processing a cipherpack message via encryptThenSign() and checkSignThenDecrypt(). More...
 
class  cipherpack::Constants
 
struct  cipherpack::CryptoConfig
 CryptoConfig, contains crypto algorithms settings given at encryption wired via the Cipherpack Data Stream, hence received and used at decryption if matching keys are available. More...
 
class  cipherpack::environment
 
class  cipherpack::PackHeader
 Cipherpack header less encrypted keys or signatures as described in Cipherpack Data Stream. More...
 
class  cipherpack::WrappingDataSource
 This class represents an abstract data source object. More...
 

Namespaces

namespace  cipherpack
 
namespace  cipherpack::hash_util
 Hash utility functions to produce a hash file compatible to sha256sum as well as to produce the hash value itself for validation.
 

Macros

#define JAVA_MAIN_PACKAGE   "org/cipherpack/"
 

Typedefs

typedef std::shared_ptr< CipherpackListener > cipherpack::CipherpackListenerRef
 
template<typename T >
using cipherpack::secure_vector = std::vector< T, Botan::secure_allocator< T > >
 

Functions

bool cipherpack::hash_util::append_to_file (const std::string &out_file, const std::string &hashed_file, const std::string_view &hash_algo, const std::vector< uint8_t > &hash_value) noexcept
 Append the hash signature to the text file out_file. More...
 
std::unique_ptr< std::vector< uint8_t > > cipherpack::hash_util::calc (const std::string_view &algo, const std::string &path_or_uri, uint64_t &bytes_hashed, jau::fraction_i64 timeout=20_s) noexcept
 Return the calculated hash value using given algo name and the bytes of a single file or all files if denoting a directory. More...
 
std::unique_ptr< std::vector< uint8_t > > cipherpack::hash_util::calc (const std::string_view &algo, jau::io::ByteInStream &source) noexcept
 Return the calculated hash value using given algo name and byte input stream. More...
 
PackHeader cipherpack::checkSignThenDecrypt (const std::vector< std::string > &sign_pub_keys, const std::string &dec_sec_key_fname, const jau::io::secure_string &passphrase, jau::io::ByteInStream &source, CipherpackListenerRef listener, const std::string_view &plaintext_hash_algo, const std::string destination_fname="")
 Verify signature then decrypt the source passing to the CipherpackListener if opt-in and also optionally store into destination file. More...
 
std::string_view cipherpack::default_hash_algo () noexcept
 Name of default hash algo for the plaintext message, e.g. More...
 
PackHeader cipherpack::encryptThenSign (const CryptoConfig &crypto_cfg, const std::vector< std::string > &enc_pub_keys, const std::string &sign_sec_key_fname, const jau::io::secure_string &passphrase, jau::io::ByteInStream &source, const std::string &target_path, const std::string &subject, const std::string &plaintext_version, const std::string &plaintext_version_parent, CipherpackListenerRef listener, const std::string_view &plaintext_hash_algo, const std::string destination_fname="")
 Encrypt then sign the source producing a cipherpack stream passed to the CipherpackListener if opt-in and also optionally store into destination_fname. More...
 
std::string cipherpack::hash_util::file_suffix (const std::string &algo) noexcept
 Return a lower-case file suffix used to store a sha256sum compatible hash signature w/o dot and w/o dashes. More...
 
std::shared_ptr< Botan::Private_Key > cipherpack::load_private_key (const std::string &privatekey_fname, const jau::io::secure_string &passphrase)
 
std::shared_ptr< Botan::Public_Key > cipherpack::load_public_key (const std::string &pubkey_fname)
 
std::string cipherpack::to_string (const PackHeader &ph) noexcept