SSP21-CPP
SecureDynamicBuffer.h
1 
2 #ifndef SSP21_SECUREDYNAMICBUFFER_H
3 #define SSP21_SECUREDYNAMICBUFFER_H
4 
5 #include "ser4cpp/container/Buffer.h"
6 
7 #include "ssp21/crypto/Crypto.h"
8 
9 
10 namespace ssp21
11 {
12 
13  /**
14  * A dynamic buffer that clears itself when deleted
15  */
16  class SecureDynamicBuffer final : public ser4cpp::Buffer
17  {
18 
19  public:
20 
21  explicit SecureDynamicBuffer(uint32_t size) : ser4cpp::Buffer(size)
22  {}
23 
25  {
26  Crypto::zero_memory(this->as_wslice());
27  }
28 
29  };
30 
31 
32 }
33 
34 #endif
SSP21-cpp main namespace.
Definition: BufferTypes.h:12