|
|
1.1 root 1: /*
2: Copyright (c) 2008 TrueCrypt Foundation. All rights reserved.
3:
4: Governed by the TrueCrypt License 2.4 the full text of which is contained
5: in the file License.txt included in TrueCrypt binary and source code
6: distribution packages.
7: */
8:
9: #ifndef TC_HEADER_Encryption_Keyfile
10: #define TC_HEADER_Encryption_Keyfile
11:
12: #include "Platform/Platform.h"
13: #include "Platform/Stream.h"
14: #include "VolumePassword.h"
15:
16: namespace TrueCrypt
17: {
18: class Keyfile;
19: typedef list < shared_ptr <Keyfile> > KeyfileList;
20:
21: class Keyfile
22: {
23: public:
24: Keyfile (const FilesystemPath &path) : Path (path) { }
25: virtual ~Keyfile () { };
26:
27: operator FilesystemPath () const { return Path; }
28: static shared_ptr <VolumePassword> ApplyListToPassword (shared_ptr <KeyfileList> keyfiles, shared_ptr <VolumePassword> password);
29: static shared_ptr <KeyfileList> DeserializeList (shared_ptr <Stream> stream, const string &name);
30: static void SerializeList (shared_ptr <Stream> stream, const string &name, shared_ptr <KeyfileList> keyfiles);
31:
32: static const int MinProcessedLength = 1;
33: static const int MaxProcessedLength = 1024 * 1024;
34:
35: protected:
36: void Apply (const BufferPtr &pool) const;
37:
38: FilesystemPath Path;
39:
40: private:
41: Keyfile (const Keyfile &);
42: Keyfile &operator= (const Keyfile &);
43: };
44: }
45:
46: #endif // TC_HEADER_Encryption_Keyfile
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.