Implement an mlock()'d string class for storing passphrases

SecureString is identical to std::string except with secure_allocator
substituting for std::allocator. This makes casting between them
impossible, so converting between the two at API boundaries requires
calling ::c_str() for now.
This commit is contained in:
Dylan Noblesmith
2011-12-20 18:42:30 -05:00
committed by Luke Dashjr
parent f503a1486a
commit 96f1723bb1
9 changed files with 40 additions and 54 deletions
+4
View File
@@ -286,6 +286,10 @@ public:
// This is exactly like std::string, but with a custom allocator.
// (secure_allocator<> is defined in serialize.h)
typedef std::basic_string<char, std::char_traits<char>, secure_allocator<char> > SecureString;