diff --git a/native/cpp/CommonCpp/grpc/Client.h b/native/cpp/CommonCpp/grpc/Client.h --- a/native/cpp/CommonCpp/grpc/Client.h +++ b/native/cpp/CommonCpp/grpc/Client.h @@ -46,6 +46,8 @@ void setOnCloseCallback(std::function callback); void closeGetStream(); void assignSetReadyStateCallback(std::function callback); + + std::string sessionSignature(std::string deviceID); }; } // namespace network diff --git a/native/cpp/CommonCpp/grpc/Client.cpp b/native/cpp/CommonCpp/grpc/Client.cpp --- a/native/cpp/CommonCpp/grpc/Client.cpp +++ b/native/cpp/CommonCpp/grpc/Client.cpp @@ -127,5 +127,18 @@ this->clientGetReadReactor->assignSetReadyStateCallback(callback); } +std::string Client::sessionSignature(std::string deviceID) { + grpc::ClientContext context; + tunnelbroker::SessionSignatureRequest request; + tunnelbroker::SessionSignatureResponse response; + + request.set_deviceid(deviceID); + auto status{this->stub_->SessionSignature(&context, request, &response)}; + if (!status.ok()) { + return NULL; + } + return response.tosign(); +} + } // namespace network } // namespace comm