Botan 3.9.0
Crypto and TLS for C&
|
#include <data_src.h>
Public Member Functions | |
bool | check_available (size_t n) override |
DataSource_Memory (const std::vector< uint8_t > &in) | |
DataSource_Memory (const uint8_t in[], size_t length) | |
DataSource_Memory (secure_vector< uint8_t > in) | |
DataSource_Memory (std::span< const uint8_t > in) | |
DataSource_Memory (std::string_view in) | |
size_t | discard_next (size_t N) |
bool | end_of_data () const override |
size_t | get_bytes_read () const override |
virtual std::string | id () const |
size_t | peek (uint8_t buf[], size_t length, size_t offset) const override |
size_t | peek_byte (uint8_t &out) const |
size_t | read (uint8_t buf[], size_t length) override |
std::optional< uint8_t > | read_byte () |
size_t | read_byte (uint8_t &out) |
This class represents a Memory-Based DataSource
Definition at line 111 of file data_src.h.
|
explicit |
Construct a memory source that reads from a string
in | the string to read from |
Definition at line 108 of file data_src.cpp.
References Botan::as_span_of_bytes(), and DataSource_Memory().
Referenced by DataSource_Memory().
|
inline |
Construct a memory source that reads from a byte array
in | the byte array to read from |
length | the length of the byte array |
Definition at line 129 of file data_src.h.
|
inlineexplicit |
Construct a memory source that reads from a secure_vector
in | the MemoryRegion to read from |
Definition at line 135 of file data_src.h.
|
inlineexplicit |
Construct a memory source that reads from an arbitrary byte buffer
in | the MemoryRegion to read from |
Definition at line 141 of file data_src.h.
|
inlineexplicit |
Construct a memory source that reads from a std::vector
in | the MemoryRegion to read from |
Definition at line 147 of file data_src.h.
|
overridevirtual |
Implements Botan::DataSource.
Definition at line 80 of file data_src.cpp.
|
inherited |
Discard the next N bytes of the data
N | the number of bytes to discard |
Definition at line 53 of file data_src.cpp.
References read().
|
overridevirtual |
Test whether the source still has data that can be read.
Implements Botan::DataSource.
Definition at line 101 of file data_src.cpp.
|
inlineoverridevirtual |
Implements Botan::DataSource.
Definition at line 149 of file data_src.h.
|
inlinevirtualinherited |
return the id of this data source
Reimplemented in Botan::DataSource_Stream.
Definition at line 63 of file data_src.h.
|
overridevirtual |
Read from the source but do not modify the internal offset. Consecutive calls to peek() will return portions of the source starting at the same position.
out | the byte array to write the output to |
length | the length of the byte array out |
peek_offset | the offset into the stream to read at |
Implements Botan::DataSource.
Definition at line 87 of file data_src.cpp.
References Botan::copy_mem().
|
inherited |
Peek at one byte.
out | an output byte |
Definition at line 46 of file data_src.cpp.
References peek().
Referenced by Botan::ASN1::maybe_BER().
|
overridevirtual |
Read from the source. Moves the internal offset so that every call to read will return a new portion of the source.
out | the byte array to write the result to |
length | the length of the byte array out |
Implements Botan::DataSource.
Definition at line 73 of file data_src.cpp.
References Botan::copy_mem().
|
inherited |
Read one byte.
Returns nullopt if no further bytes are available
Definition at line 34 of file data_src.cpp.
References read().
|
inherited |
Read one byte.
out | the byte to read to |
Definition at line 27 of file data_src.cpp.
References read().
Referenced by Botan::PEM_Code::decode(), and Botan::ASN1::maybe_BER().