Azure REST API Helpers for Modern C++. Featuring helper functions for date-time, encryption tokens for Azure REST API as a single header-only package and native Win32 libraries.
$ dotnet add package SiddiqSoft.AzureCppUtilsNot every facility of OpenSSL or Crypto lib is provided here. Our focus is to curate code that is of most use when using the Azure ServiceBus, Cosmos, Events REST API. Moreover, the API focusses on the
std::stringand while we've attempted to provide for an API that can be used withstd::wstringthe later is utf-8 conversion fromstd::string.
date-utils.hpp)
base64-utils.hpp)
encryption-utils.hpp)
..
.. # import the CPM.cmake module and activate..
..
CPMAddModule("gh:siddiqsoft/AzureCppUtils#3.0.0")
..
..
target_link_libraries(your-project PRIVATE AzureCppUtils::AzureCppUtils)
// Get a SAS signature for ServiceBus API
std::string keyname {"RootManageSharedAccessKey"};
std::string key {"myPrimaryKey"};
std::string url {"myNamespace.servicebus.windows.net/myEventHub"};
// In this test, we're providing the epoch as the expiry string: 1629608276.
// corresponds to Sunday, August 22, 2021 4:57:56 AM UTC
auto sas = EncryptionUtils::SASToken<char>(key, url, keyname, "1629608276");
// Alternatively, you can specify minutes, hours from "now"
auto sas = EncryptionUtils::SASToken<char>(key, url, keyname, std::chrono::minutes(60));
© 2021 Siddiq Software. All rights reserved.