12 #include <botan/data_src.h>
13 #include <botan/exceptn.h>
14 #include <initializer_list>
69 void write(
const uint8_t in[],
size_t length);
76 { write(in.data(), in.size()); }
82 void write(
const std::vector<uint8_t>& in)
83 { write(in.data(), in.size()); }
89 void write(
const std::string& in);
101 void write(uint8_t in);
108 void process_msg(
const uint8_t in[],
size_t length);
120 void process_msg(
const std::vector<uint8_t>& in);
126 void process_msg(
const std::string& in);
151 size_t read(uint8_t output[],
size_t length) override BOTAN_WARN_UNUSED_RESULT;
162 size_t read(uint8_t output[],
size_t length, message_id msg) BOTAN_WARN_UNUSED_RESULT;
173 size_t read(uint8_t& output, message_id msg = DEFAULT_MESSAGE) BOTAN_WARN_UNUSED_RESULT;
180 secure_vector<uint8_t> read_all(message_id msg = DEFAULT_MESSAGE) BOTAN_WARN_UNUSED_RESULT;
187 std::
string read_all_as_string(message_id msg = DEFAULT_MESSAGE) BOTAN_WARN_UNUSED_RESULT;
198 size_t peek(uint8_t output[],
size_t length,
size_t offset) const override BOTAN_WARN_UNUSED_RESULT;
209 size_t peek(uint8_t output[],
size_t length,
210 size_t offset, message_id msg) const BOTAN_WARN_UNUSED_RESULT;
220 size_t peek(uint8_t& output,
size_t offset,
221 message_id msg = DEFAULT_MESSAGE) const BOTAN_WARN_UNUSED_RESULT;
226 size_t get_bytes_read() const override;
231 size_t get_bytes_read(message_id msg) const;
233 bool check_available(
size_t n) override;
234 bool check_available_msg(
size_t n, message_id msg);
239 size_t default_msg()
const {
return m_default_read; }
246 void set_default_msg(message_id msg);
252 message_id message_count()
const;
258 bool end_of_data()
const override;
278 BOTAN_DEPRECATED(
"Runtime modification of Pipe deprecated")
279 void prepend(
Filter* filt);
288 BOTAN_DEPRECATED("Runtime modification of
Pipe deprecated")
289 void append(
Filter* filt);
294 BOTAN_DEPRECATED("Runtime modification of
Pipe deprecated")
300 BOTAN_DEPRECATED("Runtime modification of
Pipe deprecated")
312 void append_filter(
Filter* filt);
323 void prepend_filter(
Filter* filt);
339 Pipe& operator=(const
Pipe&) = delete;
344 void do_append(Filter* filt);
345 void do_prepend(Filter* filt);
346 void find_endpoints(Filter*);
347 void clear_endpoints(Filter*);
349 message_id get_message_no(const
std::
string&, message_id) const;
353 message_id m_default_read;
375 #if defined(BOTAN_HAS_PIPE_UNIXFD_IO)
376 #include <botan/fd_unix.h>
int(* final)(unsigned char *, CTX *)
#define BOTAN_PUBLIC_API(maj, min)
#define BOTAN_WARN_UNUSED_RESULT
static const message_id DEFAULT_MESSAGE
std::string to_string(ErrorType type)
Convert an ErrorType to string.
std::vector< T, secure_allocator< T >> secure_vector
static const message_id LAST_MESSAGE
void write(const secure_vector< uint8_t > &in)
void write(const std::vector< uint8_t > &in)
Invalid_Message_Number(const std::string &where, message_id msg)