CCF
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
ccf::Channel Class Reference

#include <channels.h>

Public Member Functions

 Channel (ringbuffer::AbstractWriterFactory &writer_factory, const ccf::crypto::Pem &service_cert_, ccf::crypto::KeyPairPtr node_kp_, const ccf::crypto::Pem &node_cert_, const NodeId &self_, const NodeId &peer_id_, size_t message_limit_)
 
bool channel_open ()
 
bool send (NodeMsgType type, std::span< const uint8_t > aad, std::span< const uint8_t > plain={})
 
bool recv_authenticated (std::span< const uint8_t > aad, const uint8_t *&data, size_t &size)
 
bool recv_authenticated_with_load (const uint8_t *&data, size_t &size)
 
std::optional< std::vector< uint8_t > > recv_encrypted (std::span< const uint8_t > aad, const uint8_t *&data, size_t &size)
 
void close_channel ()
 
bool recv_key_exchange_message (const uint8_t *data, size_t size)
 

Static Public Member Functions

static std::chrono::system_clock::duration & min_gap_between_initiation_attempts ()
 

Static Public Attributes

static constexpr size_t protocol_version = 1
 

Constructor & Destructor Documentation

◆ Channel()

ccf::Channel::Channel ( ringbuffer::AbstractWriterFactory writer_factory,
const ccf::crypto::Pem service_cert_,
ccf::crypto::KeyPairPtr  node_kp_,
const ccf::crypto::Pem node_cert_,
const NodeId self_,
const NodeId peer_id_,
size_t  message_limit_ 
)
inline

Member Function Documentation

◆ channel_open()

bool ccf::Channel::channel_open ( )
inline

◆ close_channel()

void ccf::Channel::close_channel ( )
inline

◆ min_gap_between_initiation_attempts()

static std::chrono::system_clock::duration & ccf::Channel::min_gap_between_initiation_attempts ( )
inlinestatic

◆ recv_authenticated()

bool ccf::Channel::recv_authenticated ( std::span< const uint8_t >  aad,
const uint8_t *&  data,
size_t &  size 
)
inline

◆ recv_authenticated_with_load()

bool ccf::Channel::recv_authenticated_with_load ( const uint8_t *&  data,
size_t &  size 
)
inline

◆ recv_encrypted()

std::optional< std::vector< uint8_t > > ccf::Channel::recv_encrypted ( std::span< const uint8_t >  aad,
const uint8_t *&  data,
size_t &  size 
)
inline

◆ recv_key_exchange_message()

bool ccf::Channel::recv_key_exchange_message ( const uint8_t *  data,
size_t  size 
)
inline

◆ send()

bool ccf::Channel::send ( NodeMsgType  type,
std::span< const uint8_t >  aad,
std::span< const uint8_t >  plain = {} 
)
inline

Member Data Documentation

◆ protocol_version

constexpr size_t ccf::Channel::protocol_version = 1
staticconstexpr

The documentation for this class was generated from the following file: