| Disk ARchive 2.5.10 Full featured and portable backup and archiving tool

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

crypto.hpp
Go to the documentation of this file.
1 //*********************************************************************/
2 // dar - disk archive - a backup/restoration program
3 // Copyright (C) 2002-2052 Denis Corbin
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 //
19 // to contact the author : http://dar.linux.free.fr/email.html
20 /*********************************************************************/
21
25
26 #ifndef CRYPTO_HPP
27 #define CRYPTO_HPP
28
29 extern "C"
30 {
31
32 }
33
34 #include "../my_config.h"
35 #include <string>
36
37 #include "datetime.hpp"
38
39 #include <list>
40
41 namespace libdar
42 {
43
46
48
51 enum crypto_algo
52 {
53 crypto_none,
54 crypto_scrambling,
55 crypto_blowfish,
56 crypto_aes256,
57 crypto_twofish256,
58 crypto_serpent256,
59 crypto_camellia256
60 };
61
62
63 struct signator
64 {
65 enum
66 {
67 good, //< good signature
68 bad, //< key correct bug signature tempered
69 unknown_key, //< no key found to check the signature
70 error //< signature failed to be checked for other error
71 } result; //< status of the signing
72 enum
73 {
74 valid, //< the key we have is neither expired nor revoked
75 expired, //< the key we have has expired
76 revoked //< the key we have has been revoked
77 } key_validity; //< validity of the key used to verify the signature
78 std::string fingerprint; //< fingerprint of the key
79 datetime signing_date; //< date of signature
80 datetime signature_expiration_date; //< date of expiration of this signature
81 bool operator < (const signator & ref) const { return fingerprint < ref.fingerprint; };
82 bool operator == (const signator & ref) const { return result == ref.result && key_validity == ref.key_validity && fingerprint == ref.fingerprint && signature_expiration_date == ref.signature_expiration_date; };
83 };
84
85
86 extern std::string crypto_algo_2_string(crypto_algo algo);
87
88 extern char crypto_algo_2_char(crypto_algo a);
89 extern crypto_algo char_2_crypto_algo(char a);
90
91 extern bool same_signatories(const std::list<signator> & a, const std::list<signator> & b);
92
94
95 } // end of namespace
96
97 #endif
libdar::crypto_twofish256
twofish 256 strong encryption
Definition: crypto.hpp:57
libdar::crypto_camellia256
camellia 256 strong encryption
Definition: crypto.hpp:59
libdar::crypto_algo
crypto_algo
the different cypher available for encryption (strong or weak)
Definition: crypto.hpp:51
libdar::crypto_serpent256
serpent 256 strong encryption
Definition: crypto.hpp:58
datetime.hpp
this file contains the definition of class datetime that stores unix times in a portable way ...
libdar::crypto_none
no encryption
Definition: crypto.hpp:53
libdar::crypto_blowfish
blowfish strong encryption
Definition: crypto.hpp:55
libdar::crypto_scrambling
scrambling weak encryption
Definition: crypto.hpp:54
libdar::crypto_aes256
AES 256 strong encryption.
Definition: crypto.hpp:56
libdar
libdar namespace encapsulate all libdar symbols
Definition: archive.hpp:47