xtd - Reference Guide  0.1.1
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
secure_string.h
Go to the documentation of this file.
1 #pragma once
5 #include <vector>
6 #include "../ustring.h"
7 
9 namespace xtd {
11  namespace security {
18  class secure_string final : public xtd::object {
19  public:
21  secure_string() = default;
22 
27  secure_string(const char value[], size_t length);
28 
30  secure_string(secure_string&&) = default;
31  secure_string(const secure_string&) = default;
32  secure_string& operator=(const secure_string&) = default;
33  bool empty() const noexcept;
35 
38  intptr_t data() const noexcept;
39 
42  size_t size() const noexcept;
43 
47  std::string to_unsecure_string() const noexcept;
48 
49  private:
50  std::vector<byte_t> data_;
51  };
52  }
53 }
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition: object.h:26
Represents text that should be kept confidential, such as by deleting it from computer memory when no...
Definition: secure_string.h:18
secure_string(const char value[], size_t length)
This API supports the product infrastructure and is not intended to be used directly from your code....
intptr_t data() const noexcept
Gets underlying encrypted data.
std::string to_unsecure_string() const noexcept
Gets decrypted data.
secure_string()=default
Initializes a new instance of the xtd::security::secure_string class.
size_t size
Represents a size of any object in bytes.
Definition: types.h:171
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17