26 #ifndef HEADER_VERSION_HPP
27 #define HEADER_VERSION_HPP
29 #include "../my_config.h"
67 void set_command_line(
const std::string & line) {
cmd_line = line; };
68 void set_initial_offset(
const infinint & offset) {
initial_offset = offset; };
69 void set_sym_crypto_algo(
const crypto_algo & algo) {
sym = algo; };
80 void set_signed(
bool is_signed) {
arch_signed = is_signed; };
86 void set_compression_block_size(
const infinint & bs) {
compr_bs = bs; };
90 const archive_version & get_edition()
const {
return edition; };
92 const std::string & get_command_line()
const {
return cmd_line; };
93 const infinint & get_initial_offset()
const {
return initial_offset; };
98 std::string get_sym_crypto_name()
const;
99 std::string get_asym_crypto_name()
const;
100 memory_file *get_crypted_key()
const {
return crypted_key; };
101 const slice_layout *get_slice_layout()
const {
return ref_layout; };
103 const std::string & get_salt()
const {
return salt; };
104 const infinint & get_iteration_count()
const {
return iteration_count; };
106 const infinint & get_compression_block_size()
const {
return compr_bs; };
110 void display(user_interaction & dialg)
const;
set of datastructures used to interact with a catalogue object
class archive_version that rules which archive format to follow
class archive_version manages the version of the archive format
this is the interface class from which all other data transfer classes inherit
the arbitrary large positive integer class
generic_file stored in memory
This is a pure virtual class that is used by libdar when interaction with the user is required.
compression parameters for API
the crypto algoritm definition
class generic_file is defined here as well as class fichier
hash_algo
hashing algorithm available
compression
the different compression algorithm available
crypto_algo
the different cypher available for encryption (strong or weak)
archive_version edition
archive format
void set_slice_layout(slice_layout *layout)
the object pointed to by layout is passed under the responsibility of this header_version object
void set_crypted_key(memory_file *key)
the object pointed to by key passes to the responsibility of this header_version object
std::string salt
used for key derivation
bool has_tape_marks
whether the archive contains tape marks aka escape marks aka sequence marks
hash_algo kdf_hash
used for key derivation
memory_file * crypted_key
optional field containing the asymmetrically ciphered key used for strong encryption ciphering
bool has_kdf_params
has salt/ineration/kdf_hash fields valid
void read(generic_file &f, user_interaction &dialog, bool lax_mode)
read the header or trailer from the archive
void write(generic_file &f) const
write down the object to the archive (as header if wrote at the beginning of the archive,...
compression algo_zip
compression algorithm used
slice_layout * ref_layout
optional field used in isolated catalogues to record the slicing layout of their archive of reference
infinint iteration_count
used for key derivation
bool arch_signed
whether the archive is signed
std::string cmd_line
used long ago to store cmd_line, then abandonned, then recycled as a user comment field
static constexpr U_I PRE_FORMAT_10_ITERATION
fixed value used for key derivation before archive format 10
bool ciphered
whether the archive is ciphered, even if we do not know its crypto algorithm (old archives)
infinint compr_bs
the compression block size (0 for legacy compression mode)
infinint initial_offset
defines at which offset starts the archive (passed the archive header), this field is obiously only u...
crypto_algo sym
strong encryption algorithm used for symmetrical encryption
switch module to limitint (32 ou 64 bits integers) or infinint
Memory_file is a generic_file class that only uses virtual memory.
libdar namespace encapsulate all libdar symbols
object describing the slicing of an archive
defines the interaction interface between libdar and users.