ProvisioningLibrary
Atmel Security Provisioning Library
atcaprov_request.h File Reference

Message handling routine declarations, structures, and constants. More...

#include <stddef.h>
#include <stdint.h>
#include "atcaprov_return_codes.h"

Go to the source code of this file.

Data Structures

struct  atcaprov_request_s
 
struct  atcaprov_response_state_s
 
struct  atcaprov_cert_data_s
 

Macros

#define ATCAPROV_BSON_REQ_MAC_SIZE   (32)
 
#define ATCAPROV_BSON_REQ_KEY_SIZE   (32)
 
#define ATCAPROV_BSON_REQ_PUBKEY_SIZE   (64)
 
#define ATCAPROV_BSON_REQ_CONFIG_SIZE   (128)
 

Typedefs

typedef struct atcaprov_request_s atcaprov_request_t
 
typedef struct atcaprov_response_state_s atcaprov_response_state_t
 
typedef enum atcaprov_zone_e atcaprov_zone_t
 
typedef enum atcaprov_data_flag_e atcaprov_data_flag_t
 
typedef struct atcaprov_cert_data_s atcaprov_cert_data_t
 

Enumerations

enum  atcaprov_zone_e { ATCAPROV_ZONE_CONFIG = 0, ATCAPROV_ZONE_OTP = 1, ATCAPROV_ZONE_DATA = 2 }
 
enum  atcaprov_data_flag_e { ATCAPROV_DATA_DYN_CERTS = 0x01, ATCAPROV_DATA_FULL_CERTS = 0x02, ATCAPROV_DATA_CERT_DEFS = 0x04 }
 

Functions

int atcaprov_request_certificates (const atcaprov_request_t *request, int data_flags, atcaprov_response_state_t *state, void *user_data)
 Request certificates from the provisioning server. More...
 
int atcaprov_get_next_cert_data (atcaprov_cert_data_t *cert_data, atcaprov_response_state_t *state, void *user_data)
 Gets the next certificate data chunk from the certificate request response. More...
 
int atcaprov_get_request_id (void)
 Gets a number identifying the request. More...
 
int atcaprov_get_full_certs (atcaprov_response_state_t *state, uint8_t *signer_cert, size_t *signer_cert_size, uint8_t *device_cert, size_t *device_cert_size)
 

Detailed Description

Message handling routine declarations, structures, and constants.

Macro Definition Documentation

#define ATCAPROV_BSON_REQ_CONFIG_SIZE   (128)
#define ATCAPROV_BSON_REQ_KEY_SIZE   (32)
#define ATCAPROV_BSON_REQ_MAC_SIZE   (32)
#define ATCAPROV_BSON_REQ_PUBKEY_SIZE   (64)

Typedef Documentation

Structure for returning a chunk of certificate data to be written to the device.

Certificate request parameters needed by atcaprov_request_certificates

Structure for maintaining the response parsing state machine

Enumeration Type Documentation

Enumerator
ATCAPROV_DATA_DYN_CERTS 
ATCAPROV_DATA_FULL_CERTS 
ATCAPROV_DATA_CERT_DEFS 
Enumerator
ATCAPROV_ZONE_CONFIG 
ATCAPROV_ZONE_OTP 
ATCAPROV_ZONE_DATA 

Function Documentation

int atcaprov_get_full_certs ( atcaprov_response_state_t state,
uint8_t *  signer_cert,
size_t *  signer_cert_size,
uint8_t *  device_cert,
size_t *  device_cert_size 
)
int atcaprov_get_next_cert_data ( atcaprov_cert_data_t cert_data,
atcaprov_response_state_t state,
void *  user_data 
)

Gets the next certificate data chunk from the certificate request response.

Parameters
[out]cert_dataCertificate data chunk returned.
[in]stateResponse parsing state.
[in]user_dataPointer to user specified data to be passed to any user callback functions.
Returns
0 on success, ATCAPROV_NO_MORE_CERT_DATA if there is no more data
int atcaprov_get_request_id ( void  )

Gets a number identifying the request.

Returns
Request ID
int atcaprov_request_certificates ( const atcaprov_request_t request,
int  data_flags,
atcaprov_response_state_t state,
void *  user_data 
)

Request certificates from the provisioning server.

Parameters
[in]requestParameters required to make the certificate request.
[in]data_flagsFlags indicating what kind of data to request. From teh atcaprov_data_flag_e enum.
[out]stateResponse parsing state to be passed to other response functions (atcaprov_get_next_cert_data).
[in]user_dataPointer to user specified data to be passed to any user callback functions.
Returns
0 on success