// C++/WinRT v2.0.250303.1 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #pragma once #ifndef WINRT_Windows_Security_Credentials_2_H #define WINRT_Windows_Security_Credentials_2_H #include "winrt/impl/Windows.Foundation.1.h" #include "winrt/impl/Windows.Foundation.Collections.1.h" #include "winrt/impl/Windows.Storage.Streams.1.h" #include "winrt/impl/Windows.UI.1.h" #include "winrt/impl/Windows.Security.Credentials.1.h" WINRT_EXPORT namespace winrt::Windows::Security::Credentials { struct AttestationChallengeHandler : winrt::Windows::Foundation::IUnknown { AttestationChallengeHandler(std::nullptr_t = nullptr) noexcept {} AttestationChallengeHandler(void* ptr, take_ownership_from_abi_t) noexcept : winrt::Windows::Foundation::IUnknown(ptr, take_ownership_from_abi) {} template AttestationChallengeHandler(L lambda); template AttestationChallengeHandler(F* function); template AttestationChallengeHandler(O* object, M method); template AttestationChallengeHandler(com_ptr&& object, M method); template AttestationChallengeHandler(weak_ref&& object, LM&& lambda_or_method); template AttestationChallengeHandler(std::shared_ptr&& object, M method); template AttestationChallengeHandler(std::weak_ptr&& object, LM&& lambda_or_method); auto operator()(winrt::Windows::Storage::Streams::IBuffer const& challenge) const; }; struct WINRT_IMPL_EMPTY_BASES KeyCredential : winrt::Windows::Security::Credentials::IKeyCredential, impl::require { KeyCredential(std::nullptr_t) noexcept {} KeyCredential(void* ptr, take_ownership_from_abi_t) noexcept : winrt::Windows::Security::Credentials::IKeyCredential(ptr, take_ownership_from_abi) {} }; struct WINRT_IMPL_EMPTY_BASES KeyCredentialAttestationResult : winrt::Windows::Security::Credentials::IKeyCredentialAttestationResult { KeyCredentialAttestationResult(std::nullptr_t) noexcept {} KeyCredentialAttestationResult(void* ptr, take_ownership_from_abi_t) noexcept : winrt::Windows::Security::Credentials::IKeyCredentialAttestationResult(ptr, take_ownership_from_abi) {} }; struct WINRT_IMPL_EMPTY_BASES KeyCredentialCacheConfiguration : winrt::Windows::Security::Credentials::IKeyCredentialCacheConfiguration { KeyCredentialCacheConfiguration(std::nullptr_t) noexcept {} KeyCredentialCacheConfiguration(void* ptr, take_ownership_from_abi_t) noexcept : winrt::Windows::Security::Credentials::IKeyCredentialCacheConfiguration(ptr, take_ownership_from_abi) {} KeyCredentialCacheConfiguration(winrt::Windows::Security::Credentials::KeyCredentialCacheOption const& cacheOption, winrt::Windows::Foundation::TimeSpan const& timeout, uint32_t usageCount); }; struct KeyCredentialManager { KeyCredentialManager() = delete; static auto RequestCreateForWindowAsync(winrt::Windows::UI::WindowId const& window, param::hstring const& name, winrt::Windows::Security::Credentials::KeyCredentialCreationOption const& option); static auto IsSupportedAsync(); static auto RenewAttestationAsync(); static auto RequestCreateAsync(param::hstring const& name, winrt::Windows::Security::Credentials::KeyCredentialCreationOption const& option); static auto OpenAsync(param::hstring const& name); static auto DeleteAsync(param::hstring const& name); static auto RequestCreateAsync(param::hstring const& name, winrt::Windows::Security::Credentials::KeyCredentialCreationOption const& option, param::hstring const& algorithm, param::hstring const& message, winrt::Windows::Security::Credentials::KeyCredentialCacheConfiguration const& cacheConfiguration, winrt::Windows::UI::WindowId const& windowId, winrt::Windows::Security::Credentials::ChallengeResponseKind const& callbackType, winrt::Windows::Security::Credentials::AttestationChallengeHandler const& attestationCallback); static auto OpenAsync(param::hstring const& name, winrt::Windows::Security::Credentials::ChallengeResponseKind const& callbackType, winrt::Windows::Security::Credentials::AttestationChallengeHandler const& attestationCallback); static auto GetSecureId(); }; struct WINRT_IMPL_EMPTY_BASES KeyCredentialOperationResult : winrt::Windows::Security::Credentials::IKeyCredentialOperationResult { KeyCredentialOperationResult(std::nullptr_t) noexcept {} KeyCredentialOperationResult(void* ptr, take_ownership_from_abi_t) noexcept : winrt::Windows::Security::Credentials::IKeyCredentialOperationResult(ptr, take_ownership_from_abi) {} }; struct WINRT_IMPL_EMPTY_BASES KeyCredentialRetrievalResult : winrt::Windows::Security::Credentials::IKeyCredentialRetrievalResult { KeyCredentialRetrievalResult(std::nullptr_t) noexcept {} KeyCredentialRetrievalResult(void* ptr, take_ownership_from_abi_t) noexcept : winrt::Windows::Security::Credentials::IKeyCredentialRetrievalResult(ptr, take_ownership_from_abi) {} }; struct WINRT_IMPL_EMPTY_BASES PasswordCredential : winrt::Windows::Security::Credentials::IPasswordCredential { PasswordCredential(std::nullptr_t) noexcept {} PasswordCredential(void* ptr, take_ownership_from_abi_t) noexcept : winrt::Windows::Security::Credentials::IPasswordCredential(ptr, take_ownership_from_abi) {} PasswordCredential(); PasswordCredential(param::hstring const& resource, param::hstring const& userName, param::hstring const& password); }; struct WINRT_IMPL_EMPTY_BASES PasswordCredentialPropertyStore : winrt::Windows::Foundation::Collections::IPropertySet { PasswordCredentialPropertyStore(std::nullptr_t) noexcept {} PasswordCredentialPropertyStore(void* ptr, take_ownership_from_abi_t) noexcept : winrt::Windows::Foundation::Collections::IPropertySet(ptr, take_ownership_from_abi) {} PasswordCredentialPropertyStore(); }; struct WINRT_IMPL_EMPTY_BASES PasswordVault : winrt::Windows::Security::Credentials::IPasswordVault { PasswordVault(std::nullptr_t) noexcept {} PasswordVault(void* ptr, take_ownership_from_abi_t) noexcept : winrt::Windows::Security::Credentials::IPasswordVault(ptr, take_ownership_from_abi) {} PasswordVault(); }; struct WINRT_IMPL_EMPTY_BASES WebAccount : winrt::Windows::Security::Credentials::IWebAccount, impl::require { WebAccount(std::nullptr_t) noexcept {} WebAccount(void* ptr, take_ownership_from_abi_t) noexcept : winrt::Windows::Security::Credentials::IWebAccount(ptr, take_ownership_from_abi) {} WebAccount(winrt::Windows::Security::Credentials::WebAccountProvider const& webAccountProvider, param::hstring const& userName, winrt::Windows::Security::Credentials::WebAccountState const& state); }; struct WINRT_IMPL_EMPTY_BASES WebAccountProvider : winrt::Windows::Security::Credentials::IWebAccountProvider, impl::require { WebAccountProvider(std::nullptr_t) noexcept {} WebAccountProvider(void* ptr, take_ownership_from_abi_t) noexcept : winrt::Windows::Security::Credentials::IWebAccountProvider(ptr, take_ownership_from_abi) {} WebAccountProvider(param::hstring const& id, param::hstring const& displayName, winrt::Windows::Foundation::Uri const& iconUri); }; } #endif