fixup sample , add to build (#2808)
This commit is contained in:
parent
dd906a9b0d
commit
10a46b3132
@ -95,3 +95,4 @@ add_subdirectory(sdk/identity)
|
||||
add_subdirectory(sdk/keyvault)
|
||||
add_subdirectory(sdk/storage)
|
||||
add_subdirectory(sdk/template)
|
||||
add_subdirectory(samples/integration/vcpkg-keyvault)
|
||||
|
||||
@ -16,10 +16,6 @@ project(Application-using-keyvault-from-vcpkg LANGUAGES CXX)
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||
|
||||
find_package(CURL REQUIRED)
|
||||
find_package(azure-security-keyvault-keys-cpp CONFIG REQUIRED)
|
||||
find_package(azure-identity-cpp CONFIG REQUIRED)
|
||||
|
||||
add_executable (
|
||||
application
|
||||
src/main
|
||||
|
||||
@ -12,9 +12,14 @@
|
||||
* - AZURE_CLIENT_SECRET: The client secret.
|
||||
*
|
||||
*/
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
#endif
|
||||
|
||||
#include <azure/core.hpp>
|
||||
#include <azure/identity.hpp>
|
||||
#include <azure/keyvault/key_vault.hpp>
|
||||
#include <azure/keyvault/keyvault_keys.hpp>
|
||||
|
||||
#include <chrono>
|
||||
#include <iostream>
|
||||
@ -44,7 +49,7 @@ int main()
|
||||
|
||||
KeyVaultKey cloudRsaKey = keyClient.GetKey(rsaKeyName).Value;
|
||||
std::cout << "Key is returned with name " << cloudRsaKey.Name() << " and type "
|
||||
<< KeyType::KeyTypeToString(cloudRsaKey.GetKeyType()) << std::endl;
|
||||
<< cloudRsaKey.GetKeyType().ToString() << std::endl;
|
||||
|
||||
cloudRsaKey.Properties.ExpiresOn
|
||||
= cloudRsaKey.Properties.ExpiresOn.Value() + std::chrono::hours(24 * 365);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user