Botan 2.1.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

secqueue.h
Go to the documentation of this file.
1 /*
2 * SecureQueue
3 * (C) 1999-2007 Jack Lloyd
4 * 2012 Markus Wanner
5 *
6 * Botan is released under the Simplified BSD License (see license.txt)
7 */
8
9 #ifndef BOTAN_SECURE_QUEUE_H__
10 #define BOTAN_SECURE_QUEUE_H__
11
12 #include <botan/data_src.h>
13 #include <botan/filter.h>
14
15 namespace Botan {
16
17 /**
18 * A queue that knows how to zeroize itself
19 */
20 class BOTAN_DLL SecureQueue : public Fanout_Filter, public DataSource
21 {
22 public:
23 std::string name() const override { return "Queue"; }
24
25 void write(const uint8_t[], size_t) override;
26
27 size_t read(uint8_t[], size_t) override;
28 size_t peek(uint8_t[], size_t, size_t = 0) const override;
29 size_t get_bytes_read() const override;
30
31 bool end_of_data() const override;
32
33 bool empty() const;
34
35 bool check_available(size_t n) override { return n <= size(); }
36
37 /**
38 * @return number of bytes available in the queue
39 */
40 size_t size() const;
41
42 bool attachable() override { return false; }
43
44 /**
45 * SecureQueue assignment
46 * @param other the queue to copy
47 */
48 SecureQueue& operator=(const SecureQueue& other);
49
50 /**
51 * SecureQueue default constructor (creates empty queue)
52 */
53 SecureQueue();
54
55 /**
56 * SecureQueue copy constructor
57 * @param other the queue to copy
58 */
59 SecureQueue(const SecureQueue& other);
60
61 ~SecureQueue() { destroy(); }
62
63 private:
64 void destroy();
65 size_t m_bytes_read;
66 class SecureQueueNode* m_head;
67 class SecureQueueNode* m_tail;
68 };
69
70 }
71
72 #endif
Botan::SecureQueue
Definition: secqueue.h:20
Botan::Fanout_Filter
Definition: filter.h:152
Botan::SecureQueue::name
std::string name() const override
Definition: secqueue.h:23
Botan::DataSource
Definition: data_src.h:21
Botan
Definition: alg_id.cpp:13
Botan::SecureQueue::attachable
bool attachable() override
Definition: secqueue.h:42
Botan::SecureQueue::~SecureQueue
~SecureQueue()
Definition: secqueue.h:61
Botan::SecureQueue::check_available
bool check_available(size_t n) override
Definition: secqueue.h:35