Android-cuttlefish cvd tool
|
#include <confui_cbor.h>
Classes | |
class | CborDeleter |
Public Member Functions | |
Cbor (const std::string &prompt_text, const std::vector< std::uint8_t > &extra_data) | |
bool | IsOk () const |
Error | GetErrorCode () const |
bool | IsMessageTooLong () const |
bool | IsMalformedUtf8 () const |
std::vector< std::uint8_t > && | GetMessage () |
Public Attributes | |
const std::uint32_t | kMax = static_cast<std::uint32_t>(MessageSize::MAX) |
Private Types | |
enum class | Error : uint32_t { OK = 0 , OUT_OF_DATA = 1 , MALFORMED = 2 , MALFORMED_UTF8 = 3 } |
enum class | MessageSize : uint32_t { MAX = 6144u } |
enum class | Type : uint8_t { NUMBER = 0 , NEGATIVE = 1 , BYTE_STRING = 2 , TEXT_STRING = 3 , ARRAY = 4 , MAP = 5 , TAG = 6 , FLOAT = 7 } |
Private Member Functions | |
void | Init () |
Error | CheckUTF8Copy (const std::string &text) |
Private Attributes | |
std::unique_ptr< cbor_item_t, CborDeleter > | cb_map_ |
std::string | prompt_text_ |
std::vector< std::uint8_t > | extra_data_ |
Error | buffer_status_ |
std::vector< std::uint8_t > | buffer_ |
take prompt_text_, extra_data returns CBOR map, created with the two
Usage: if (IsOk()) GetMessage()
The CBOR map is used to create signed confirmation
|
strongprivate |
|
strongprivate |
|
strongprivate |
|
inline |
|
private |
|
inline |
std::vector< std::uint8_t > && cuttlefish::confui::Cbor::GetMessage | ( | ) |
|
private |
basically, this creates a map as follows: {"prompt" : prompt_text_in_UTF8, "extra" : extra_data_in_bytes}
|
inline |
|
inline |
|
inline |
|
private |
|
private |
|
private |
|
private |
const std::uint32_t cuttlefish::confui::Cbor::kMax = static_cast<std::uint32_t>(MessageSize::MAX) |
When encoded, the Cbor object should not exceed this limit in terms of size in bytes
|
private |