17 #ifndef HTTPDATAPROCESSOR_HPP_
18 #define HTTPDATAPROCESSOR_HPP_
22 #if defined(KAA_DEFAULT_BOOTSTRAP_HTTP_CHANNEL) || \
23 defined(KAA_DEFAULT_OPERATION_HTTP_CHANNEL) || \
24 defined(KAA_DEFAULT_LONG_POLL_CHANNEL)
30 #include <boost/noncopyable.hpp>
32 #include <botan/base64.h>
43 class HttpDataProcessor : boost::noncopyable {
45 HttpDataProcessor(
const PublicKey& pubKey,
48 encDec_(new RsaEncoderDecoder(pubKey, privKey, remoteKey)) { }
49 HttpDataProcessor() { }
51 std::shared_ptr<IHttpRequest> createOperationRequest(
const HttpUrl& url,
const std::vector<std::uint8_t>& data);
52 std::string retrieveOperationResponse(
const IHttpResponse& response);
54 std::shared_ptr<IHttpRequest> createBootstrapRequest(
const HttpUrl& url,
const std::vector<std::uint8_t>& data);
55 std::string retrieveBootstrapResponse(
const IHttpResponse& response);
57 void setEncoderDecoder(std::shared_ptr<IEncoderDecoder> encoderDecoder) { encDec_ = encoderDecoder; }
60 std::shared_ptr<IHttpRequest> createHttpRequest(
const HttpUrl& url,
const std::vector<std::uint8_t>& data,
bool sign);
62 void verifyResponse(
const IHttpResponse& response);
65 std::shared_ptr<IEncoderDecoder> encDec_;
69 typedef std::shared_ptr<HttpDataProcessor> HttpDataProcessorPtr;
Botan::MemoryVector< std::uint8_t > PublicKey