Botan 3.6.1
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[], size_t, size_t) const override |
size_t | peek_byte (uint8_t &out) const |
size_t | read (uint8_t[], size_t) override |
size_t | read_byte (uint8_t &out) |
This class represents a Memory-Based DataSource
Definition at line 100 of file data_src.h.
|
explicit |
Construct a memory source that reads from a string
in | the string to read from |
Definition at line 95 of file data_src.cpp.
|
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 118 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 124 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 130 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 136 of file data_src.h.
|
overridevirtual |
Implements Botan::DataSource.
Definition at line 67 of file data_src.cpp.
|
inherited |
Discard the next N bytes of the data
N | the number of bytes to discard |
Definition at line 40 of file data_src.cpp.
References Botan::DataSource::read().
|
overridevirtual |
Test whether the source still has data that can be read.
Implements Botan::DataSource.
Definition at line 88 of file data_src.cpp.
|
inlineoverridevirtual |
Implements Botan::DataSource.
Definition at line 138 of file data_src.h.
|
inlinevirtualinherited |
return the id of this data source
Reimplemented in Botan::DataSource_Stream.
Definition at line 61 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 74 of file data_src.cpp.
References Botan::copy_mem().
|
inherited |
Peek at one byte.
out | an output byte |
Definition at line 33 of file data_src.cpp.
References Botan::DataSource::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 60 of file data_src.cpp.
References Botan::copy_mem().
|
inherited |
Read one byte.
out | the byte to read to |
Definition at line 26 of file data_src.cpp.
References Botan::DataSource::read().
Referenced by Botan::PEM_Code::decode(), Botan::BER_Decoder::discard_remaining(), and Botan::ASN1::maybe_BER().