| 1 | /*++ |
| 2 | |
| 3 | Copyright (c) Microsoft. All rights reserved. |
| 4 | |
| 5 | Module Name: |
| 6 | |
| 7 | WinCredStorage.h |
| 8 | |
| 9 | Abstract: |
| 10 | |
| 11 | Windows Credential Manager credential storage backend. |
| 12 | |
| 13 | --*/ |
| 14 | #pragma once |
| 15 | |
| 16 | #include "ICredentialStorage.h" |
| 17 | |
| 18 | namespace wsl::windows::wslc::services { |
| 19 | |
| 20 | class WinCredStorage final : public ICredentialStorage |
| 21 | { |
| 22 | public: |
| 23 | void Store(const std::string& serverAddress, const std::string& username, const std::string& secret) override; |
| 24 | std::pair<std::string, std::string> Get(const std::string& serverAddress) override; |
| 25 | void Erase(const std::string& serverAddress) override; |
| 26 | std::vector<std::wstring> List() override; |
| 27 | |
| 28 | private: |
| 29 | static std::wstring TargetName(const std::string& serverAddress); |
| 30 | }; |
| 31 | |
| 32 | } // namespace wsl::windows::wslc::services |