ProvisioningLibrary
Atmel Security Provisioning Library
|
BSON (http://bsonspec.org/) handling routines for working with the provisioning server messages. More...
#include "atcaprov_bson.h"
Functions | |
const uint8_t * | bson_memfind (const uint8_t *area, size_t area_size, const uint8_t *data, size_t data_size) |
Find binary data within a search area. More... | |
int32_t | bson_dec_int32 (const uint8_t *data) |
Decode a BSON int32 value. More... | |
void | bson_enc_int32 (uint8_t *data, int32_t value) |
Encode a BSON int32 value. More... | |
void | bson_enc_bool (uint8_t *data, int value) |
Encode a BSON boolean value. More... | |
const uint8_t * | bson_find_field (const uint8_t *area, size_t area_size, uint8_t type, const char *name, uint32_t *size, int index) |
Simple routine to find fields in BSON data. More... | |
BSON (http://bsonspec.org/) handling routines for working with the provisioning server messages.
int32_t bson_dec_int32 | ( | const uint8_t * | data | ) |
Decode a BSON int32 value.
void bson_enc_bool | ( | uint8_t * | data, |
int | value | ||
) |
Encode a BSON boolean value.
void bson_enc_int32 | ( | uint8_t * | data, |
int32_t | value | ||
) |
Encode a BSON int32 value.
const uint8_t* bson_find_field | ( | const uint8_t * | area, |
size_t | area_size, | ||
uint8_t | type, | ||
const char * | name, | ||
uint32_t * | size, | ||
int | index | ||
) |
Simple routine to find fields in BSON data.
This is a simple routine that works for the simple BSON we're dealing with. It won't work for all possible BSON data. Notes that when searching for binary data (type=0x05), the returned pointer points to the binary type flag. The actual binary data starts at the next byte.
[in] | area | Pointer to the BSON data to search. |
[in] | area_size | Size of the BSON data in bytes. |
[in] | type | Field type to search for. |
[in] | name | Filed name to search for. |
[out] | size | Size of the found field data returned here. Can be set to NULL if not needed. |
[in] | index | If the field type and name appears multiple times, find this instance. 0 is the first one. |
const uint8_t* bson_memfind | ( | const uint8_t * | area, |
size_t | area_size, | ||
const uint8_t * | data, | ||
size_t | data_size | ||
) |
Find binary data within a search area.