diff --git a/include/WinStd/Crypt.h b/include/WinStd/Crypt.h index cff9eb8b..ea2dd58b 100644 --- a/include/WinStd/Crypt.h +++ b/include/WinStd/Crypt.h @@ -548,6 +548,25 @@ namespace winstd class WINSTD_API cert_store : public handle { public: + /// + /// Initializes a new class instance with the object handle set to NULL. + /// + inline cert_store() : handle() {} + + /// + /// Initializes a new class instance with an already available object handle. + /// + /// \param[in] h Initial object handle value + /// + inline cert_store(_In_opt_ handle_type h) : handle(h) {} + + /// + /// Move constructor + /// + /// \param[inout] h A rvalue reference of another object + /// + inline cert_store(_Inout_ cert_store &&h) : handle(std::move(h)) {} + /// /// Closes the certificate store. /// @@ -555,6 +574,18 @@ namespace winstd /// virtual ~cert_store(); + /// + /// Move assignment + /// + /// \param[inout] h A rvalue reference of another object + /// + cert_store& operator=(_Inout_ cert_store &&h) + { + if (this != std::addressof(h)) + *(handle*)this = std::move(h); + return *this; + } + /// /// Opens the certificate store. /// @@ -593,6 +624,11 @@ namespace winstd return false; } + private: + // This class is noncopyable. + cert_store(_In_ const cert_store &h); + cert_store& operator=(_In_ const cert_store &h); + protected: /// /// Closes the certificate store.