xtd 0.2.0
Loading...
Searching...
No Matches
secure_string.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "../string.hpp"
6#include <vector>
7
9namespace xtd {
11 namespace security {
22 class secure_string final : public xtd::object {
23 public:
25
28 secure_string() = default;
29
34 secure_string(const char value[], xtd::size length);
36
38 secure_string(secure_string&&) = default;
39 secure_string(const secure_string&) = default;
40 auto operator =(secure_string&&) -> secure_string& = default;
41 auto operator =(const secure_string&) -> secure_string& = default;
42 [[nodiscard]] auto empty() const noexcept -> bool;
44
46
50 [[nodiscard]] auto data() const noexcept -> intptr;
51
54 [[nodiscard]] auto length() const noexcept -> xtd::size;
55
58 [[nodiscard]] auto size() const noexcept -> xtd::size;
60
62
67 [[nodiscard]] auto to_unsecure_string() const noexcept -> xtd::string;
69
70 private:
71 xtd::array<xtd::byte> data_;
72 };
73 }
74}
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:64
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:45
auto data() const noexcept -> intptr
Gets underlying encrypted data.
auto to_unsecure_string() const noexcept -> xtd::string
Gets decrypted data.
auto size() const noexcept -> xtd::size
Gets underlying encrypted data size.
secure_string(const char value[], xtd::size length)
This API supports the product infrastructure and is not intended to be used directly from your code....
auto length() const noexcept -> xtd::size
Gets underlying encrypted data size.
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 size.hpp:23
std::intmax_t intptr
Represent a pointer or a handle.
Definition intptr.hpp:23
Provides the underlying structure of the security system, including base classes for permissions.
Definition secure_string.hpp:11
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
Contains xtd::string alias.