24 lines
898 B
C++
24 lines
898 B
C++
|
#pragma once
|
||
|
#include "../Streams/Stream.hpp"
|
||
|
|
||
|
|
||
|
namespace Tesses::Framework::Crypto
|
||
|
{
|
||
|
class ClientTLSStream : public Tesses::Framework::Streams::Stream {
|
||
|
void* privateData;
|
||
|
static int strm_send(void* ctx,const unsigned char* buf,size_t len);
|
||
|
static int strm_recv(void* ctx,unsigned char* buf,size_t len);
|
||
|
public:
|
||
|
static std::string GetCertChain();
|
||
|
|
||
|
ClientTLSStream(Tesses::Framework::Streams::Stream* innerStream, bool owns, bool verify, std::string domain);
|
||
|
ClientTLSStream(Tesses::Framework::Streams::Stream* innerStream, bool owns, bool verify, std::string domain, std::string cert);
|
||
|
size_t Read(uint8_t* buff, size_t sz);
|
||
|
size_t Write(const uint8_t* buff, size_t sz);
|
||
|
bool CanRead();
|
||
|
bool CanWrite();
|
||
|
bool EndOfStream();
|
||
|
~ClientTLSStream();
|
||
|
};
|
||
|
|
||
|
}
|