xtd 0.2.0
secure_string.h
Go to the documentation of this file.
1 #pragma once
5 #include "../ustring.h"
6 #include <vector>
7 
9 namespace xtd {
11  namespace security {
20  class secure_string final : public xtd::object {
21  public:
23 
26  secure_string() = default;
27 
32  secure_string(const char value[], size_t length);
34 
36  secure_string(secure_string&&) = default;
37  secure_string(const secure_string&) = default;
38  secure_string& operator =(const secure_string&) = default;
39  bool empty() const noexcept;
41 
43 
47  intptr data() const noexcept;
48 
51  size_t size() const noexcept;
53 
55 
60  std::string to_unsecure_string() const noexcept;
62 
63  private:
64  std::vector<xtd::byte> data_;
65  };
66  }
67 }
intmax_t intptr
Represent a pointer or a handle.
Definition: types.h:151
secure_string()=default
Initializes a new instance of the xtd::security::secure_string class.
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
size_t size() const noexcept
Gets underlying encrypted data size.
std::string to_unsecure_string() const noexcept
Gets decrypted data.
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes...
Definition: object.h:32
Represents text that should be kept confidential, such as by deleting it from computer memory when no...
Definition: secure_string.h:20
intptr data() const noexcept
Gets underlying encrypted data.